-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catch clone_repo exception #225
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LorisOnori I have some requests before merging your pull request.
Moreover, please add a reference to the issue you're solving
credentialdigger/client.py
Outdated
from github import Github | ||
from git import GitCommandError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow alphabetical order of imports (you can use isort
if you don't want to do it manually)
credentialdigger/client.py
Outdated
logger.info(f"{i}/{repos_num} Ignore {repo_url} " | ||
"(it can not be cloned)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please note all the strings are defined by single quotes ('
) and not double ones ("
) so we have to be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logger is in an exception so it shouldn't be at info level.
Better to use either warning or error
@@ -100,6 +100,7 @@ def get_git_repo(self, repo_url, local_repo): | |||
GitRepo.clone_from(repo_url, project_path) | |||
repo = GitRepo(project_path) | |||
except GitCommandError as e: | |||
logger.debug("Repo can not be cloned") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments as before, on quotes and logger level
Added
GitCommandError
exception handler inscan_user
. The exception is raised when the repository cannot be cloned. This pull request solves issue #183