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

🌱 silence gocritic warnings by specifying enabled checks #4546

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spencerschrock
Copy link
Member

What kind of change does this PR introduce?

linter config

What is the current behavior?

Some checks run by default, some run because we enable them.

What is the new behavior (if this is a feature change)?**

Disable all the checks, then turn the ones we want on one-by-one. This list matches what we already had in the config, plus the checks which are enabled by default. The end result is the same list of linters (confirmed with GL_DEBUG=gocritic golangci-lint run --enable=gocritic but we silence the warnings reported in #4439.

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

Fixes #4439

Special notes for your reviewer

I also sorted the list, and one or two existing values moved around, if you look commit by commit it's easier to see the added default checks, and the sort.

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)

NONE

Disable all the checks, then turn the ones we want on one-by-one. This
list matches what we already had in the config, plus the checks which
are enabled by default. The end result is the same list of linters, but
we silence the warnings reported in ossf#4439.

Signed-off-by: Spencer Schrock <[email protected]>
@spencerschrock spencerschrock requested a review from a team as a code owner March 3, 2025 15:53
@spencerschrock spencerschrock requested review from justaugustus and raghavkaul and removed request for a team March 3, 2025 15:53
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.36%. Comparing base (353ed60) to head (b9a6075).
Report is 124 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4546      +/-   ##
==========================================
+ Coverage   66.80%   68.36%   +1.56%     
==========================================
  Files         230      248      +18     
  Lines       16602    18762    +2160     
==========================================
+ Hits        11091    12827    +1736     
- Misses       4808     5084     +276     
- Partials      703      851     +148     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

golangci-lint warnings
1 participant