Skip to content

Commit

Permalink
Actually use golangci-lint config. (#1106)
Browse files Browse the repository at this point in the history
* Actually use golangci-lint config.

golangci-config uses `.golangci.yaml` as the default config path.
Previously we were using `.golang-ci.yaml` so changes weren't taking
affect.

* Update lint.yaml
  • Loading branch information
wlynch committed Apr 25, 2024
1 parent 14eb574 commit 2b5054e
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 88 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand All @@ -33,7 +33,6 @@ jobs:
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --timeout 10m0s

# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
Expand Down
86 changes: 0 additions & 86 deletions .golang-ci.yaml

This file was deleted.

68 changes: 68 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Documentation: https://golangci-lint.run/usage/configuration/
linters:
disable-all: true
enable:
- bodyclose
- containedctx
- decorder
- depguard
- dogsled
- dupl
- dupword
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- goconst
- gocritic
- gofmt
- goimports
- gomodguard
- gosec
- gosimple
- govet
- ireturn
- maintidx
- makezero
- misspell
- musttag
- nakedret
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- revive
- staticcheck
- thelper
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
output:
uniq-by-line: false
issues:
# Only flag new issues
new: true
exclude-rules:
- path: _test\.go
linters:
- errcheck
- gosec
max-issues-per-linter: 0
max-same-issues: 0
include:
# Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment.
- EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012
- EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014
run:
issues-exit-code: 1
build-tags:
- e2e
# skip-dirs:
# - vendor
timeout: 20m
modules-download-mode: vendor

0 comments on commit 2b5054e

Please sign in to comment.