-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Less verbose format checking #5733
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, Can I ask you what your usage of the The Also, the formatters are run when using |
Not sure if I am doing something wrong but For example, given this code: // main project
package main
import (
"fmt"
)
func main() {
fmt.Println("Test")
} When I run the linter it reports no issues: $ ./bin/golangci-lint run --default all --disable forbidigo
0 issues. Once I run the formatter it does detect the formatting is wrong though: $ ./bin/golangci-lint fmt --diff
diff /Users/maxnunes/Development/test-go-linter-fmt/main.go.orig /Users/maxnunes/Development/test-go-linter-fmt/main.go
--- /Users/maxnunes/Development/test-go-linter-fmt/main.go.orig
+++ /Users/maxnunes/Development/test-go-linter-fmt/main.go
@@ -6,5 +6,5 @@
)
func main() {
-fmt.Println("Test")
+ fmt.Println("Test")
} |
ok, it's because you are using the default formatter. Use the following configuration to enable a formatter: version: "2"
formatters:
enable:
- gofmt |
that works, thanks! |
Welcome
How did you install golangci-lint?
Official binary
Your feature request related to a problem? Please describe
Running
golangci-lint fmt --diff
can be quite verbose when there are a lot of files not well formatted.Describe the solution you'd like
It would be nice if there was a
--check
option like prettier --check. Where it prints only the file name, not the file content.Describe alternatives you've considered
I tried piping the output to
/dev/null
as a workaround. But I was having trouble making it work in different OS environments. So, it would be nice if it was available built-in on the linter tool.Additional context
A bit related to #5601.
Supporter
The text was updated successfully, but these errors were encountered: