From 3b056ac404ef95ff720255cf4ef8c97e4f87e90c Mon Sep 17 00:00:00 2001 From: Travis Cline Date: Thu, 12 Sep 2024 18:05:32 -0700 Subject: [PATCH] lint: fixup lint settings --- .github/workflows/ci.yaml | 12 ++++-------- .golangci.yaml | 40 +++++++++++++++++++-------------------- Makefile | 2 +- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9a6a44a87..1759a2a05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,21 +9,17 @@ on: - main jobs: - lint: + name: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' - # Cache is managed by golangci-lint - # https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs - cache: false + go-version-file: go.mod - name: golangci-lint - uses: golangci/golangci-lint-action@v6.0.1 + uses: golangci/golangci-lint-action@v6 with: - args: --timeout=4m - version: v1.59.1 + version: v1.60 build-examples: runs-on: ubuntu-latest steps: diff --git a/.golangci.yaml b/.golangci.yaml index d347aae9e..a53a9a5ac 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -14,27 +14,25 @@ linters: - test - unused disable: - - godox # We allow TODO lines. - - tagliatelle # As we're dealing with third parties we must accept snake case. - - wsl # We don't agree with wsl's style rules - - exhaustruct - - lll - - varnamelen - - nlreturn - - gomnd - - err113 - - wrapcheck # TODO: we should probably enable this one (at least for new code). - - testpackage - - nolintlint # see https://github.com/golangci/golangci-lint/issues/3228. - - depguard # disabling temporarily - - ireturn # disabling temporarily - - perfsprint - - musttag - - tagalign # Impractical for schema-defined output parser, which relies heavily on struct tagging. - - mnd - - canonicalheader - - intrange - - testifylint + - godox # We allow TODO lines in our codebase + - tagliatelle # We need to accept snake case due to third-party integrations + - wsl # We disagree with wsl's opinionated style rules + - exhaustruct # Disabling to allow partial struct initialization + - lll # Line length limits are not enforced + - varnamelen # Variable name length is not strictly enforced + - nlreturn # Not requiring newline before return + - gomnd # Allowing magic numbers in code + - wrapcheck # TODO: Consider enabling for new code to improve error handling + - testpackage # Allowing tests in same package as code + - nolintlint # Known issue: https://github.com/golangci/golangci-lint/issues/3228 + - depguard + - ireturn + - perfsprint # Not enforcing performance optimizations for fmt.Sprint + - musttag # Not enforcing struct field tags + - tagalign # Impractical for schema-defined output parser with heavy struct tagging + - intrange # Not enforcing int type range checks + - testifylint # Not enforcing testify-specific lint rules + - goerr113 # Allowing dynamic error creation linters-settings: cyclop: diff --git a/Makefile b/Makefile index 868b9f28b..84e3450eb 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ lint-all: lint-deps: @command -v golangci-lint >/dev/null 2>&1 || { \ echo >&2 "golangci-lint not found. Installing..."; \ - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.1; \ + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0; \ } .PHONY: docs