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

Update golangci-lint linters in all projects #231

Open
tpantelis opened this issue Aug 27, 2024 · 0 comments
Open

Update golangci-lint linters in all projects #231

tpantelis opened this issue Aug 27, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request priority:low

Comments

@tpantelis
Copy link
Contributor

It's been about 3 years since we last reviewed the available linters and enabled the ones we want. That was golangci-lint v1.43 and now it's up to 1.60.3 and they've added quite a few more. Here's the list that we have disabled right now:

canonicalheader: canonicalheader checks whether net/http.Header uses canonical header [fast: false, auto-fix: false]
cyclop: checks function and package cyclomatic complexity [fast: false, auto-fix: false]
exhaustruct: Checks if all structure fields are initialized [fast: false, auto-fix: false]
fatcontext: detects nested contexts in loops [fast: false, auto-fix: false]
forbidigo: Forbids identifiers [fast: false, auto-fix: false]
forcetypeassert: finds forced type assertions [fast: true, auto-fix: false]
funlen: Tool for detection of long functions [fast: true, auto-fix: false]
gocheckcompilerdirectives: Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false]
gochecknoglobals: Check that no global variables exist. [fast: false, auto-fix: false]
gochecknoinits: Checks that no init functions are present in Go code [fast: true, auto-fix: false]
gochecksumtype: Run exhaustiveness checks on Go "sum types" [fast: false, auto-fix: false]
godox: Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
gomoddirectives: Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false]
gomodguard: Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false]
goprintffuncname: Checks that printf-like functions are named with `f` at the end. [fast: true, auto-fix: false]
gosmopolitan: Report certain i18n/l10n anti-patterns in your Go codebase [fast: false, auto-fix: false]
inamedparam: reports interfaces with unnamed method parameters [fast: true, auto-fix: false]
interfacebloat: A linter that checks the number of methods inside an interface. [fast: true, auto-fix: false]
intrange: intrange is a linter to find places where for loops could make use of an integer range. [fast: true, auto-fix: false]
ireturn: Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]
mirror: reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: true]
mnd: An analyzer to detect magic numbers. [fast: true, auto-fix: false]
musttag: enforce field tags in (un)marshaled structs [fast: false, auto-fix: false]
nestif: Reports deeply nested if statements [fast: true, auto-fix: false]
nlreturn: nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
noctx: Finds sending http request without context.Context [fast: false, auto-fix: false]
nonamedreturns: Reports all named returns [fast: false, auto-fix: false]
paralleltest: Detects missing usage of t.Parallel() method in your Go test [fast: false, auto-fix: false]
perfsprint: Checks that fmt.Sprintf can be replaced with a faster alternative. [fast: false, auto-fix: false]
protogetter: Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true]
rowserrcheck: checks whether Rows.Err of rows is checked successfully [fast: false, auto-fix: false]
sloglint: ensure consistent code style when using log/slog [fast: false, auto-fix: false]
spancheck: Checks for mistakes with OpenTelemetry/Census spans. [fast: false, auto-fix: false]
sqlclosecheck: Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed. [fast: false, auto-fix: false]
tagalign: check that struct tags are well aligned [fast: true, auto-fix: true]
tagliatelle: Checks the struct tags. [fast: true, auto-fix: false]
tenv: tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]
testifylint: Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false]
thelper: thelper detects tests helpers which is not start with t.Helper() method. [fast: false, auto-fix: false]
tparallel: tparallel detects inappropriate usage of t.Parallel() method in your Go test codes. [fast: false, auto-fix: false]
varnamelen: checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
zerologlint: Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg` [fast: false, auto-fix: false]
deadcode [deprecated]: Deprecated [fast: false, auto-fix: false]
execinquery [deprecated]: execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]

We should review this list and decide when ones we want to enable.

@tpantelis tpantelis added the enhancement New feature or request label Aug 27, 2024
@tpantelis tpantelis self-assigned this Aug 27, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Backlog Aug 27, 2024
@tpantelis tpantelis moved this from Backlog to Next Version Candidate in Backlog Oct 28, 2024
@maayanf24 maayanf24 removed this from Backlog Oct 29, 2024
@maayanf24 maayanf24 moved this to Todo in Submariner 0.20 Oct 29, 2024
tpantelis added a commit to tpantelis/admiral that referenced this issue Nov 13, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters.

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
tpantelis added a commit to tpantelis/admiral that referenced this issue Nov 13, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters.

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
tpantelis added a commit to tpantelis/admiral that referenced this issue Nov 13, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters.

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
tpantelis added a commit to submariner-io/admiral that referenced this issue Nov 14, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters.

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
tpantelis added a commit to tpantelis/submariner that referenced this issue Nov 15, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters. Also addressed violations reported by new linters
(in separate commits).

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
tpantelis added a commit to tpantelis/submariner that referenced this issue Nov 15, 2024
Added new linters (some commented out if not needed) and removed
deprecated linters. Also addressed violations reported by new linters
(in separate commits).

Related to submariner-io/enhancements#231

Signed-off-by: Tom Pantelis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:low
Projects
Status: In Progress
Development

No branches or pull requests

1 participant