-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
refactor: enable gocritic linter and fix lint issues #342
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #342 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 626 628 +2
=========================================
+ Hits 626 628 +2 ☔ View full report in Codecov by Sentry. |
162dd73
to
049c49c
Compare
049c49c
to
d116bb4
Compare
enabled-checks: | ||
- emptyStringTest | ||
- evalOrder | ||
- paramTypeCombine | ||
- preferStringWriter | ||
- sprintfQuotedString | ||
- stringConcatSimplify | ||
- yodaStyleExpr |
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.
I tend to copy paste the descriptions available for each linters.
You can find them in enabled-checks node of .golangci-lint.reference.yml
enabled-checks: | ||
- emptyStringTest | ||
- evalOrder | ||
- paramTypeCombine | ||
- preferStringWriter | ||
- sprintfQuotedString | ||
- stringConcatSimplify | ||
- yodaStyleExpr |
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.
I tend to enable them all or enable them by tags
and disable the noisy ones, explaining why.
This way new rules are added automatically. But I do that on the repositories I maintain
thanks! |
The PR enables
gocritic
in golangci-lint's config and fixes appeared lint issues: