Skip to content

Enable 13 more linters and fix all violations#4997

Merged
denik merged 4 commits intomainfrom
denik/more-linters
Apr 20, 2026
Merged

Enable 13 more linters and fix all violations#4997
denik merged 4 commits intomainfrom
denik/more-linters

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Apr 16, 2026

Changes

  • Enable 13 additional golangci-lint linters and fix all violations. Intentional patterns (e.g. deliberate nil-error returns) are annotated with //nolint.
  • Fix IPv6-unsafe host:port formatting in apps run-local config (fmt.Sprintfnet.JoinHostPort).
  • Fix user-facing typos: "paramaters" → "parameters", "app app proxy" → "app proxy".

Why

Follow-up to #4978. These linters catch real bugs at compile time (silently discarded errors, IPv6 breakage) and prevent future regressions.

Tests

No new tests. Validated with golangci-lint run ./.... One existing test assertion updated to match a corrected error string.

@denik denik force-pushed the denik/more-linters branch from 98f7d56 to 1d1dd82 Compare April 19, 2026 12:13
denik added 4 commits April 19, 2026 13:44
Add dupword, misspell, nilerr, fatcontext, wastedassign,
nosprintfhostport, recvcheck, usetesting, nilnesserr, durationcheck,
exptostd, gocheckcompilerdirectives, asciicheck, and reassign linters
to .golangci.yaml. Fix all violations: spelling typos and duplicate
words in comments and string literals across the codebase.

Co-authored-by: Isaac
Use net.JoinHostPort in runlocal config to correctly handle IPv6
addresses. Remove wastedassign linter since it's fully redundant
with the already-enabled ineffassign linter.

Task: 002.md

Co-authored-by: Isaac
The initial commit only ran make lint (changed files). Running the full
lint suite revealed 40 pre-existing violations:
- nilerr (15): add //nolint with reasons for intentional error swallowing
- recvcheck (11): add //nolint for intentional mixed receivers
- usetesting (11): use t.TempDir()/t.Setenv() where safe, nolint where
  the os.* usage is intentional (KeepTmp, custom restore, Windows workaround)
- fatcontext (3): add //nolint for false positives (same-parent contexts)

Task: 002.md

Co-authored-by: Isaac
The nolint directive must be on the line where the issue is reported
(the return statement), not on the if statement.

Task: 002.md

Co-authored-by: Isaac
@denik denik force-pushed the denik/more-linters branch from 1d1dd82 to 981ef4b Compare April 19, 2026 13:44
Comment thread .golangci.yaml
- exptostd
- gocheckcompilerdirectives
- asciicheck
- reassign
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't drop wastedassign per the PR summary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated desc.

Copy link
Copy Markdown
Contributor

@janniklasrose janniklasrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way to lint/enforce that there's an explanation after each //nolint: ?

@denik denik added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit a698cdc Apr 20, 2026
27 of 28 checks passed
@denik denik deleted the denik/more-linters branch April 20, 2026 14:10
@denik
Copy link
Copy Markdown
Contributor Author

denik commented Apr 20, 2026

any way to lint/enforce that there's an explanation after each //nolint: ?

there is actually https://golangci-lint.run/docs/linters/configuration/#nolintlint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants