Skip to content
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

Enable linters with the least amount of code changes #76

Closed
yitsushi opened this issue Aug 30, 2022 · 0 comments · Fixed by #77
Closed

Enable linters with the least amount of code changes #76

yitsushi opened this issue Aug 30, 2022 · 0 comments · Fixed by #77
Assignees
Labels
kind/feature new feature, enhancement, improvement, extension

Comments

@yitsushi
Copy link
Contributor

No description provided.

@yitsushi yitsushi added the kind/feature new feature, enhancement, improvement, extension label Aug 30, 2022
@yitsushi yitsushi self-assigned this Aug 30, 2022
yitsushi added a commit that referenced this issue Sep 5, 2022
Enabled all linters with:
* no issues
* manageable amount of issues
* auto-fixable issues (`--fix` flag), lot of the changes are auto-fix

Started to address some of the big ones too because the output listed
only 15-20 issues first and that's not bad, but after fixed them it
listed another 15-20, so I just disabled them.

Most of the disabled linters have comment:
* why I disabled it
* why we should address those issues (for example security, stability)

Disabled linters are grouped together based on my initial thoughts:
* Logical next step: we should consider enabling these
* Opinionated: totally opinionated linters or too strict, we can ignore them.
* Disabled with reason: The reason listed next to them.
* Disabled because of generics in go 1.18: The title is self-explanatory
* Deprecated: Deprecated linters, some just abandoned, and some has got
  replaced with a newer and more maintained linters.

Configuration:
Configures a few linters to make them more reasonable.

Exclude list:
Added some excluded items, for example:
* never check line length, even if we enable it, if the line contains a URL.
* if govet find a shadowed `err` variable, ignore that.
* If a comment has a URL, ignore godox. The reason is simple, we should
  never leave a comment in the code that has "TODO" or "FIXME" without
  creating a GitHub issue, otherwise it will never be fixed.

Right now, all the running/enabled linters:
* asasalint
* asciicheck
* bidichk
* decorder
* depguard
* dogsled
* durationcheck
* errchkjson
* errname
* errorlint
* execinquery
* forbidigo
* gci
* goconst
* godot
* gofmt
* gofumpt
* goheader
* goimports
* gomodguard
* goprintffuncname
* gosimple
* govet
* grouper
* importas
* ineffassign
* makezero
* misspell
* nakedret
* noctx
* nolintlint
* nosprintfhostport
* predeclared
* promlinter
* reassign
* staticcheck
* tenv
* thelper
* tparallel
* typecheck
* unconvert
* unused
* usestdlibvars
* whitespace

Closes #76

References:
* #76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature new feature, enhancement, improvement, extension
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants