-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Disable a formatter for a path #5625
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, Currently, you cannot disable one formatter for a path, but you can exclude a path (for all formatters): formatters:
paths:
- _test.go Can you explain why do you want to apply formatters except one on a specific file? |
Thank you for the quick response! We have a lot of long one-liner in our units tests that I want to keep in a single line. Such as: createdUser := client.User.Create().SetID("dummy_id").SetName("Dummy User").SetEmail("[email protected]").SaveX(ctx) Making them multiline makes our tests much longer and less readable, so I'd like to disable this formatter for test files |
The exclusions based on a path are possible, but a directive for formatters will never happen: formatters are not linters, the formatting is applied to raw files, not parsed files. |
@ldez got it, thanks |
Welcome
How did you install golangci-lint?
Brew
Your feature request related to a problem? Please describe
(using version 2.0.1)
Can you make it possible to disable a specific formatter for a give path?
For linters we have
Use case: I want to enable
golines
everywhere but not on my_test.go
files.Describe the solution you'd like
Describe alternatives you've considered
Keeping
golines
disabledAdditional context
No response
Supporter
The text was updated successfully, but these errors were encountered: