-
Notifications
You must be signed in to change notification settings - Fork 150
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
fix: same secret should be shown once in the results output for scan command #430
fix: same secret should be shown once in the results output for scan command #430
Conversation
Codecov Report
@@ Coverage Diff @@
## main #430 +/- ##
==========================================
+ Coverage 94.51% 94.53% +0.02%
==========================================
Files 83 83
Lines 3534 3534
==========================================
+ Hits 3340 3341 +1
+ Misses 194 193 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ggshield/scan/repo.py
Outdated
for commit in commits: | ||
for file in commit.files: | ||
commit_files_tuple.append((commit, file)) |
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.
I would rename commit_files_tuple
to commit_files_tuples
, since its a list of tuples and not a list.
Also, I think you can create it using a comprehension list, like this (untested):
commit_files_tuples = [(c, f) for c in commits for f in c.files]
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.
indeed, thanks !
ggshield/scan/repo.py
Outdated
for file in commit.files | ||
) | ||
] | ||
for (commit, file), result in zip(commit_files_tuple, results.results): |
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.
Looks like we do not use file
in this loop, so it can be replaced with _
:
for (commit, file), result in zip(commit_files_tuple, results.results): | |
for (commit, _), result in zip(commit_files_tuple, results.results): |
It's interesting that this new code is probably going to be faster! 😀
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.
@agateau-gg
Side note : if I am not mistaken we do not benchmark scan repo
in the performance benchmark ? We could have seen it here. But it may be too long to include the repo option in the benchmark ?
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.
We benchmark scan commit-range
, which uses this code. But the benchmark does not show a significant change :/.
7e85e09
to
c278228
Compare
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.
Looks good, thanks!
Fixes issue #428