Skip to content

Commit

Permalink
update ci and linter for modern versions
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 7, 2024
1 parent 07aab1e commit cc246bd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: set up go 1.20
- name: set up go 1.22
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
id: go

- name: checkout
Expand All @@ -32,7 +32,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: 1.61

- name: install goveralls
run: go install github.com/mattn/goveralls@latest
Expand Down
42 changes: 31 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
linters-settings:
govet:
check-shadowing: true
shadow: true
golint:
min-confidence: 0.6
gocyclo:
Expand Down Expand Up @@ -29,18 +29,17 @@ linters-settings:
linters:
disable-all: true
enable:
- megacheck
- revive
- govet
- unconvert
- gas
- misspell
- gosec
- unparam
- unused
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- gocritic
- nakedret
- gosimple
- prealloc
Expand All @@ -49,12 +48,11 @@ linters:


run:
# modules-download-mode: vendor
skip-dirs:
- vendor
concurrency: 4

issues:
exclude-dirs:
- vendor
exclude-rules:
- text: "should have a package comment, unless it's in another file for this package"
linters:
Expand All @@ -71,13 +69,35 @@ issues:
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "integer overflow conversion"
linters:
- gosec
- text: "should have a package comment"
linters:
- revive
- text: "at least one file in a package should have a package comment"
linters:
- stylecheck
- text: "should have a package comment"
- text: "commentedOutCode: may want to remove commented-out code"
linters:
- gocritic
- text: "unnamedResult: consider giving a name to these results"
linters:
- gocritic
- text: "var-naming: don't use an underscore in package name"
linters:
- revive
- text: 'Deferring unsafe method "Close" on type "io.ReadCloser"'
- text: "should not use underscores in package names"
linters:
- gosec
- stylecheck
- text: "struct literal uses unkeyed fields"
linters:
- govet
- linters:
- unparam
- unused
- revive
path: _test\.go$
text: "unused-parameter"
exclude-use-default: false

0 comments on commit cc246bd

Please sign in to comment.