-
Notifications
You must be signed in to change notification settings - Fork 42
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
Example of a comment to disable a check at one call-site? #248
Comments
Hello!
On the bright side, there is golangci-lint tool that embeds ruleguard (through gocritic linter). Here is an example of how you can enable it there: https://quasilyte.dev/blog/post/ruleguard/#using-from-the-golangci-lint
go-critic also does that: https://github.com/go-critic/go-critic/blob/master/.golangci.yml#L44 It could be possible to implement more user-oriented features in ruleguard itself, but if we look at the main file, it becomes apparent that we're trying to be as thin analysis-based tool as possible: https://github.com/quasilyte/go-ruleguard/blob/master/cmd/ruleguard/main.go There is a reason to do it this way. ruleguard can be used as a library to build your own rule runners. For instance, go-critic embeds ruleguard as a library: https://github.com/go-critic/go-critic/blob/master/checkers/ruleguard_checker.go (without using the If In case you're not using the |
Using it thru golangci-lint, I still don't see a way to |
Through golangci-lint I've found that you can do Furthermore, the |
Does golangci-lint have any linters that can have a special comment like |
@quasilyte I don't think so. golangci-lint only supports |
Maybe we need to take a look at the specific rules then and try to make them smarter, so they have fewer false positives. Although I agree that it's unfortunate that we can't get this behavior via nolint directives. CC @ernado what do you think about additional nolint syntax? For ruleguard, I think it could be |
The downside of a metalinter wrapping a metalinter wrapping a bunch of
linters. I'd prefer to see ruleguard and other granular linters directly
in golangci-lint (which seems bound to be the "winner") rather than
go-critc and other intermediate layers.
…On Mon, Aug 16, 2021 at 3:56 AM Iskander (Alex) Sharipov < ***@***.***> wrote:
Maybe we need to take a look at the specific rules then and try to make
them smarter, so they have fewer false positives.
Although I agree that it's unfortunate that we can't get this behavior via
nolint directives.
CC @ernado <https://github.com/ernado>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#248 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKWAVE2BNJW4O4B5LRBNM3T5DVFHANCNFSM475P73FA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
I can see the point, but we'll still need something like |
Many/most linters have some sort of way to disable a specific check at a specific call-site. Are there examples on how to do this in ruleguard?
The text was updated successfully, but these errors were encountered: