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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: '0'

- name: Golangci lint
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84
uses: golangci/golangci-lint-action@v7.0.0
with:
version: v1.54
version: v2.1
args: --verbose --timeout=10m
82 changes: 48 additions & 34 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
version: "2"
run:
timeout: 3m
modules-download-mode: readonly
skip-dirs:
- test/mocks

linters-settings:
gocyclo:
min-complexity: 100
gci:
sections:
- standard
- default
- prefix(github.com/CloudNativeAI/modctl)

issues:
new: true
exclude-rules:
- linters:
- staticcheck
text: "SA1019:"

output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
linters:
disable-all: true
default: none
enable:
- gci
- gofmt
- golint
- misspell
- govet
- errcheck
- goconst
- deadcode
- gocyclo
- govet
- misspell
- staticcheck
- errcheck

output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
settings:
gocyclo:
min-complexity: 100
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
text: 'SA1019:'
paths:
- third_party$
- builtin$
- examples$
- test/mocks
issues:
new: true
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/CloudNativeAI/modctl)
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test: fmt vet ## Run unit test and display the coverage.
go tool cover -func cover.out

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
GOLANGCI_LINT_VERSION ?= v2.1.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
Expand Down