Skip to content

Commit

Permalink
chore: update linter, dependencies, and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jul 15, 2024
1 parent 51341a1 commit 027251a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 41 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand All @@ -13,20 +14,12 @@ jobs:
runs-on: ubuntu-latest
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.56.1
GOLANGCI_LINT_VERSION: v1.59.1
CGO_ENABLED: 0

steps:

# https://github.com/marketplace/actions/checkout
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout code
uses: actions/checkout@v4

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand Down
26 changes: 9 additions & 17 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
run:
timeout: 5m
skip-files: []

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
gocyclo:
min-complexity: 14
maligned:
suggest-new: true
goconst:
min-len: 3
min-occurrences: 3
Expand Down Expand Up @@ -38,16 +36,8 @@ linters-settings:
linters:
enable-all: true
disable:
- deadcode # deprecated
- exhaustivestruct # deprecated
- golint # deprecated
- ifshort # deprecated
- interfacer # deprecated
- maligned # deprecated
- nosnakecase # deprecated
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
- gomnd # deprecated
- execinquery # deprecated
- cyclop # duplicate of gocyclo
- sqlclosecheck # not relevant (SQL)
- rowserrcheck # not relevant (SQL)
Expand All @@ -56,18 +46,17 @@ linters:
- bodyclose
- prealloc
- lll
- gomnd
- mnd
- wsl
- nlreturn
- goerr113
- err113
- wrapcheck
- testpackage
- tparallel
- paralleltest
- exhaustive
- exhaustruct
- makezero
- ifshort
- noctx
- varnamelen

Expand All @@ -85,3 +74,6 @@ issues:
- forbidigo
- path: metago/metago.go
text: cyclomatic complexity 15 of func `parseMetaGo` is high
- linters:
- usestdlibvars
text: '"100" can be replaced by http.StatusContinue'
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/ldez/grignotin
go 1.20

require (
github.com/stretchr/testify v1.8.4
golang.org/x/mod v0.15.0
github.com/stretchr/testify v1.9.0
golang.org/x/mod v0.19.0
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down

0 comments on commit 027251a

Please sign in to comment.