Skip to content

Add golangci-lint config and modernize lint invocation - #28

Merged
tamalsaha merged 1 commit into
masterfrom
ci/golangci-lint-gofumpt
Jul 11, 2026
Merged

tamalsaha merged 1 commit into
masterfrom
ci/golangci-lint-gofumpt

Conversation

@tamalsaha

Copy link
Copy Markdown
Member

Summary

Add a golangci-lint v2 .golangci.yml and modernize the Makefile lint target.

Previously the lint target invoked golangci-lint run with inline flags (--enable, --skip-files, --skip-dirs, --skip-dirs-use-default). The --skip-* flags were removed in golangci-lint v2, so linting was broken against the current build image. This moves linter selection and exclusions into a config file and simplifies the Makefile invocation to golangci-lint run.

.golangci.yml

  • Enable bodyclose, goconst, prealloc, unparam (goconst + unparam preserve the previously-enabled ADDTL_LINTERS).
  • Exclusions (generated.*\.go, client, vendor) via linters.exclusions.paths.
  • Formatters: gofumpt + goimports.

Makefile

  • Replace the inline flag soup with a plain golangci-lint run.

Resulting formatting

  • gofumpt reformatting applied across the affected Go files.

- Add .golangci.yml (golangci-lint v2) enabling bodyclose, goconst, prealloc
  and unparam, with gofumpt + goimports formatters
- Replace the deprecated inline golangci-lint flags in the Makefile lint target
  (--skip-files/--skip-dirs/--skip-dirs-use-default, removed in golangci-lint v2)
  with a config-driven `golangci-lint run`
- Apply resulting gofumpt formatting

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha
tamalsaha merged commit 6e67659 into master Jul 11, 2026
4 checks passed
@tamalsaha
tamalsaha deleted the ci/golangci-lint-gofumpt branch July 11, 2026 12:26
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.

1 participant