-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add testifylint
linter
#4103
Add testifylint
linter
#4103
Conversation
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
9875ef3
to
95e419f
Compare
I will answer here about this #4072 (comment) Yes, some linters have historically init/panic because they were not designed to be used as a lib.
not PresetStyle: because the reports of your linter are not (mainly) related to the "taste" of a user or just styling. not PresetMetaLinter: because you are handling only one topic: testify.
The choice of the scope should rely on golangci-lint configuration if possible. |
@ldez, thank u for feedback
Nice point, I completely forgot about this case. Summarizing:
OutputGL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdata/testifylint.go
# github.com/golangci/golangci-lint/test.test
ld: warning: -bind_at_load is deprecated on macOS
=== RUN TestSourcesFromTestdata
linters_test.go:21: testdata/*.go
=== RUN TestSourcesFromTestdata/testifylint.go
=== PAUSE TestSourcesFromTestdata/testifylint.go
=== CONT TestSourcesFromTestdata/testifylint.go
level=info msg="[test] ran [/Users/anthony/golangci-lint/golangci-lint run --internal-cmd-test --no-config --allow-parallel-runners --disable-all --out-format=json --max-same-issues=100 -Etestifylint testifylint.go] in 979.000166ms"
level=info msg="[test] ran [/Users/anthony/golangci-lint/golangci-lint run --internal-cmd-test --no-config --allow-parallel-runners --disable-all --out-format=json --max-same-issues=100 -Etypecheck -Etestifylint testifylint.go] in 294.706667ms"
--- PASS: TestSourcesFromTestdata (10.18s)
--- PASS: TestSourcesFromTestdata/testifylint.go (1.28s)
=== RUN TestSourcesFromTestdataSubDir
--- PASS: TestSourcesFromTestdataSubDir (0.00s)
PASS
ok github.com/golangci/golangci-lint/test 12.382s
# Consul
30 "bool-compare"
183 "compares"
295 "empty"
11 "error-is-as"
463 "error-nil"
636 "expected-actual"
54 "float-compare"
30 "len"
106 "require-error"
181 "suite-dont-use-pkg"
# Grafana
145 "bool-compare"
17 "compares"
152 "empty"
36 "error-is-as"
737 "error-nil"
885 "expected-actual"
160 "float-compare"
384 "len"
362 "require-error"
# Kubernetes
34 "bool-compare"
16 "compares"
46 "empty"
119 "error-nil"
74 "expected-actual"
5 "float-compare"
89 "len"
502 "require-error" Based on the analysis I opened Antonboom/testifylint#5 but it doesn't seem to be a blocker. |
71d38d5
to
365babd
Compare
365babd
to
b6ac66c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi!
https://github.com/Antonboom/testifylint
analysis.SuggestedFix
(but no integration ingolangci-lint
? Add support for SuggestedFixes #1779)analysis.Diagnostic.Category
&URL
(but no usage of this feature ingolangci-lint
?)P.S. For local dev you need
1.21
, but the module itself I returned to1.20
by replacing useful package (slices
) with own code 😢Recreated from #4072, because of