Skip to content
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 multifile analyzer ignores #1167

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

gartnera
Copy link
Contributor

@gartnera gartnera commented Jul 11, 2024

On master, #nosec G115 will not work if your package has multiple files. This appears to be because the ignores populated in CheckRules are cleared after every file. These ignores are needed in the CheckAnalyzers call that happen after CheckRules.

Fix this by not clearing the ignores every loop. All tests cases appear to still pass:

ginkgo run
<snip>
Ran 144 of 144 Specs in 6.095 seconds
SUCCESS! -- 144 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

@gartnera gartnera marked this pull request as ready for review July 11, 2024 19:15
@ccojocar
Copy link
Member

@gartnera Thanks for this fix. Please could have a look at the lint warnings. I think you need reformat the go115_samples.go file by running the command gofumpt -w testutils/go115_samples.go.

@gartnera gartnera force-pushed the fix-multifile-ignores branch from 23c8e0d to 7a4df24 Compare July 14, 2024 18:02
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.52%. Comparing base (87fcb9b) to head (7a4df24).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1167      +/-   ##
==========================================
+ Coverage   69.25%   69.52%   +0.26%     
==========================================
  Files          71       71              
  Lines        3864     3865       +1     
==========================================
+ Hits         2676     2687      +11     
+ Misses       1069     1061       -8     
+ Partials      119      117       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gartnera gartnera requested a review from ccojocar July 14, 2024 18:07
@ccojocar ccojocar merged commit 0076267 into securego:master Jul 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants