Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: gocritic enabled-checks and disabled-checks can be combined#6090

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
skitt wants to merge1 commit intogolangci:main
base:main
Choose a base branch
Loading
fromskitt:gocritic-combinations

Conversation

@skitt
Copy link

@skittskitt commentedSep 19, 2025
edited by ldez
Loading

The documentation currently indicates that enable-checks and disabled-checks can't be combined for gocritic. That is however not accurate: as per InferEnabledChecks in the gocritic wrapper,

  • if enable-all is set, all available checks are added to the set of enabled checks
  • otherwise, unless disable-all is set, the default checks are added to the set of enabled checks
  • then the checks corresponding to each enabled tag are added
  • then all enabled checks are added (with a warning if a check is enabled multiple times)
  • then the checks corresponding to each disabled tag are removed
  • finally, all disabled checks are removed (with a warning if a check wasn't enabled)

Using both enabled-checks and disabled-checks is useful when keeping the default set of checks as reference.

This adjusts the documentation to match the implementation.

related to#4458

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign ourContributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let usrecheck it.

@boring-cyborg
Copy link

Hey, thank you for opening your first Pull Request !

@ldezldez changed the titlegocritic enabled-checks and disabled-checks can be combineddocs: gocritic enabled-checks and disabled-checks can be combinedSep 19, 2025
@ldezldez self-requested a reviewSeptember 19, 2025 14:05
@ldezldez added area: docs enhancementNew feature or improvement labelsSep 19, 2025
The documentation currently indicates that enable-checks anddisabled-checks can't be combined for gocritic. That is however notaccurate: as per InferEnabledChecks in the gocritic wrapper,* if enable-all is set, all available checks are added to the set of  enabled checks* otherwise, unless disable-all is set, the default checks are added  to the set of enabled checks* then the checks corresponding to each enabled tag are added* then all enabled checks are added (with a warning if a check is  enabled multiple times)* then the checks corresponding to each disabled tag are removed* finally, all disabled checks are removed (with a warning if a check  wasn't enabled)Using both enabled-checks and disabled-checks is useful when keepingthe default set of checks as reference.This adjusts the documentation to match the implementation.Signed-off-by: Stephen Kitt <skitt@redhat.com>
@ldez
Copy link
Member

Hello@skitt, could you sign the CLA?

@skitt
Copy link
Author

Hello@skitt, could you sign the CLA?

Sorry, I missed that part of the contribution workflow — I’ll have to get approval from our legal department.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ldezldezAwaiting requested review from ldez

At least 2 approving reviews are required to merge this pull request.

Assignees

No one assigned

Labels

area: docsenhancementNew feature or improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@skitt@CLAassistant@ldez

[8]ページ先頭

©2009-2025 Movatter.jp