Skip to content

Commit

Permalink
lint: fixup lint settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Sep 13, 2024
1 parent 862451a commit 3b056ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 19 additions & 21 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b056ac

Please sign in to comment.