-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add testifylint
linter
#4072
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
#4072
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
|
3dc614f
to
d391908
Compare
658a670
to
221be1e
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.
Your linter contains panic
and init
(and the worst panic
inside init
)
Can you revert everything not related to the implementation of your linter (the other changes must be pushed inside another PR)?
The default value of the option enable
must documented like the other linter (inside a comment)
The test file test/testdata/testifylint_test.go
should be renamed to test/testdata/testifylint.go
.
The presets should be only linter.PresetTest
and linter.PresetBugs
.
The linter should be added inside enable
and disable
section.
This is a nice practice if done wisely. My return fmt.Errorf("checker with empty name: %T", checker)
return fmt.Errorf("not uniq checker name: %v", name) Examples in other linters:
etc.
Sure.
Not problem, but just for clarification – why the linter doesn't cover
In this case, the tests will not work because the linter ignores non-test files for performance and sanity reasons.
Sure. |
This is exactly why we created this rule. |
@ldez, fixed 👌 Could you please reopen the PR? (it was closed because of comment in Antonboom/testifylint#2 🤦) And what about presets question? |
I cannot reopen the PR, you are the only one that can do that. |
Hi!
https://github.com/Antonboom/testifylint
analysis.SuggestedFix
(but no integration ingolangci-lint
?)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 😢