File tree Expand file tree Collapse file tree 4 files changed +81
-74
lines changed
Expand file tree Collapse file tree 4 files changed +81
-74
lines changed Original file line number Diff line number Diff line change 1515# 2. Update README.md to use the new path to badge.svg because the path includes the workflow name.
1616
1717name : cover ≥82.9%
18- on : [push]
18+ on : [push, pull_request ]
1919jobs :
2020
2121 # Verify minimum coverage is reached using `go test -short -cover` on latest-ubuntu with default version of Go.
2424 name : Coverage
2525 runs-on : ubuntu-latest
2626 steps :
27+ - uses : actions/setup-go@v5
28+ with :
29+ go-version : " 1.23.0"
2730 - name : Checkout code
28- uses : actions/checkout@v2
31+ uses : actions/checkout@v4
2932 - name : Go Coverage
3033 run : |
3134 go version
Original file line number Diff line number Diff line change 11# GitHub Actions - CI for Go to build & test. See ci-go-cover.yml and linters.yml for code coverage and linters.
22# Taken from: https://github.com/fxamacker/cbor/workflows/ci.yml (thanks!)
33name : ci
4- on : [push]
4+ on : [push, pull_request ]
55jobs :
66
77 # Test on Ubuntu
88 tests :
99 name : Test on Ubuntu
1010 runs-on : ubuntu-latest
1111 steps :
12+ - uses : actions/setup-go@v5
13+ with :
14+ go-version : " 1.23.0"
1215 - name : Checkout code
13- uses : actions/checkout@v1
16+ uses : actions/checkout@v4
1417 with :
1518 fetch-depth : 1
1619 - name : Run tests
1720 run : |
1821 go version
19- make test
22+ make test
Original file line number Diff line number Diff line change 11# Go Linters - GitHub Actions
22name : linters
3- on : [push]
3+ on : [push, pull_request ]
44jobs :
55
66 # Check linters on latest-ubuntu with default version of Go.
77 lint :
88 name : Lint
99 runs-on : ubuntu-latest
10- env :
11- GO111MODULE : on
1210 steps :
13- - name : Setup go
14- uses : actions/setup-go@v3
11+ - uses : actions/setup-go@v3
1512 with :
16- go-version : " 1.19 "
13+ go-version : " 1.23 "
1714 - name : Checkout code
1815 uses : actions/checkout@v2
1916 - name : Install golangci-lint
2017 run : |
2118 go version
22- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0
19+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6
2320 - name : Run required linters in .golangci.yml plus hard-coded ones here
2421 run : make -w GOLINT=$(go env GOPATH)/bin/golangci-lint lint
25- - name : Run optional linters (not required to pass)
26- run : make GOLINT=$(go env GOPATH)/bin/golangci-lint lint-extra
Original file line number Diff line number Diff line change 11# Do not delete linter settings. Linters like gocritic can be enabled on the command line.
22
3- linters-settings :
4- dupl :
5- threshold : 100
6- funlen :
7- lines : 100
8- statements : 50
9- goconst :
10- min-len : 2
11- min-occurrences : 3
12- gocritic :
13- enabled-tags :
14- - diagnostic
15- - experimental
16- - opinionated
17- - performance
18- - style
19- disabled-checks :
20- - dupImport # https://github.com/go-critic/go-critic/issues/845
21- - ifElseChain
22- - octalLiteral
23- - paramTypeCombine
24- - whyNoLint
25- - wrapperFunc
26- gofmt :
27- simplify : false
28- goimports :
29- golint :
30- min-confidence : 0
31- govet :
32- check-shadowing : true
33- lll :
34- line-length : 140
35- maligned :
36- suggest-new : true
37- misspell :
38- locale : US
39-
40- linters :
41- disable-all : true
3+ formatters :
424 enable :
43- - deadcode
44- - errcheck
45- - goconst
46- - gocyclo
475 - gofmt
486 - goimports
49- - golint
50- - gosec
51- - govet
52- - ineffassign
53- - maligned
54- - misspell
55- - staticcheck
56- - structcheck
57- - typecheck
58- - unconvert
59- - unused
60- - varcheck
7+ settings :
8+ gofmt :
9+ simplify : false
6110
11+ linters :
12+ default : none
13+ enable :
14+ - dupl # style
15+ - errcheck # bugs
16+ - funlen # complexity
17+ - goconst # style
18+ - gocritic # metalinter
19+ - gocyclo # complexity
20+ - gosec # bugs
21+ - govet # bugs
22+ - ineffassign
23+ - lll # style
24+ - misspell # comment
25+ - staticcheck # metalinter
26+ - unconvert # style
27+ - unused # unused
28+ exclusions :
29+ rules :
30+ - path : ' (.+)_test\.go'
31+ linters :
32+ - dupl
33+ - funlen
34+ - lll
35+ - goconst
36+ settings :
37+ dupl :
38+ threshold : 100
39+ funlen :
40+ lines : 100
41+ statements : 50
42+ goconst :
43+ min-len : 2
44+ min-occurrences : 3
45+ gocritic :
46+ enabled-tags :
47+ - diagnostic
48+ - experimental
49+ - opinionated
50+ - performance
51+ - style
52+ disabled-checks :
53+ - dupImport # https://github.com/go-critic/go-critic/issues/845
54+ - ifElseChain
55+ - octalLiteral
56+ - paramTypeCombine
57+ - whyNoLint
58+ - wrapperFunc
59+ govet :
60+ enable :
61+ - shadow
62+ lll :
63+ line-length : 140
64+ misspell :
65+ locale : US
6266
6367issues :
6468 # max-issues-per-linter default is 50. Set to 0 to disable limit.
@@ -72,14 +76,16 @@ issues:
7276 - goconst
7377 - dupl
7478 - gomnd
75- - lll
79+ - lll
7680 - path : doc\.go
7781 linters :
7882 - goimports
7983 - gomnd
8084 - lll
85+ - path : psatoken_fuzz_test.go
86+ linters :
87+ # the Fuzz function is only invoked by go-fuzz, therefore golangci will
88+ # see it as unused
89+ - unused
8190
82- # golangci.com configuration
83- # https://github.com/golangci/golangci/wiki/Configuration
84- service :
85- golangci-lint-version : 1.23.x # use the fixed version to not introduce new linters unexpectedly
91+ version : " 2"
You can’t perform that action at this time.
0 commit comments