Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
Add `Makefile` to your module with includes standard targets.

```Makefile
#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
2 changes: 1 addition & 1 deletion makefiles/base.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v2.3.1" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
117 changes: 66 additions & 51 deletions scripts/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,77 @@
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
# See https://golangci-lint.run/docs/linters/configuration/
version: "2"
run:
tests: true

linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
gocyclo:
min-complexity: 20
dupl:
threshold: 100
misspell:
locale: US
unparam:
check-exported: true

linters:
enable-all: true
default: all
disable:
- intrange
- wsl_v5
- funcorder
- copyloopvar
- lll
- gochecknoglobals
- wrapcheck
- paralleltest
- depguard
- dupword
- errname
- exhaustruct
- forbidigo
- forcetypeassert
- varnamelen
- tagliatelle
- errname
- gochecknoglobals
- intrange
- ireturn
- exhaustruct
- lll
- mnd
- nonamedreturns
- testableexamples
- dupword
- depguard
- paralleltest
- recvcheck
- tagalign
- mnd
- tagliatelle
- testableexamples
- testifylint
- recvcheck

issues:
exclude-use-default: false
exclude-rules:
- linters:
- mnd
- goconst
- noctx
- funlen
- dupl
- unused
- unparam
path: "_test.go"
- linters:
- errcheck # Error checking omitted for brevity.
- gosec
path: "example_"
- linters:
- revive
text: "unused-parameter: parameter"

- varnamelen
- wrapcheck
settings:
dupl:
threshold: 100
errcheck:
check-type-assertions: true
check-blank: true
gocyclo:
min-complexity: 20
misspell:
locale: US
unparam:
check-exported: true
exclusions:
generated: lax
rules:
- linters:
- dupl
- funlen
- goconst
- mnd
- noctx
- unparam
- unused
path: _test.go
- linters:
- errcheck
- gosec
path: example_
- linters:
- revive
text: 'unused-parameter: parameter'
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

[ -z "$GO" ] && GO=go
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.64.5"
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.3.1"

# detecting GOPATH and removing trailing "/" if any
GOPATH="$(go env GOPATH)"
Expand Down
4 changes: 2 additions & 2 deletions templates/github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
go-version: stable
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.5.0
uses: golangci/golangci-lint-action@v8.0.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.64.5
version: v2.4.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
Loading