Skip to content

Commit

Permalink
update linter 1.62.2 (#10)
Browse files Browse the repository at this point in the history
* update linter 1.62.2
  • Loading branch information
edii authored Dec 18, 2024
1 parent b8ea7b2 commit 6fe1f6a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 56 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
go-version: [1.23.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -32,33 +34,35 @@ jobs:
lint:
strategy:
matrix:
go-version: [1.22.x]
go-version: [1.23.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.59.1
version: v1.62.2
args: -v --config config/.golangci-no-plugin.yml
lint-plugin:
strategy:
matrix:
go: [1.22.x]
go: [1.23.x]
os: [ubuntu-latest]
name: lint-plugin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v3
check-latest: true
cache: true
- uses: actions/checkout@v4
name: Checkout code
- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
- name: Build plugin
run: |
go build --buildmode plugin -o cerrl.so plugin/cerrl.go
Expand All @@ -71,19 +75,21 @@ jobs:
# lint-plugin:
# strategy:
# matrix:
# go: [1.22.x]
# go: [1.23.x]
# os: [ubuntu-latest]
# name: lint-plugin
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/setup-go@v3
# - uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.go }}
# - uses: actions/checkout@v3
# check-latest: true
# cache: true
# - uses: actions/checkout@v4
# name: Checkout code
# - name: Install golangci-lint
# run: |
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
# - name: Build plugin
# run: |
# curl -L -o go-lint-cerrl.zip https://github.com/edenlabllc/go-lint-cerrl/archive/refs/tags/v0.1.0.zip
Expand Down
23 changes: 10 additions & 13 deletions config/.golangci-no-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,14 @@ linters-settings:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
mnd:
checks:
- argument
- case
- condition
- return
govet:
check-shadowing: true
shadow: true
lll:
line-length: 140
maligned:
Expand Down Expand Up @@ -153,7 +150,7 @@ linters:
- gofmt
- goimports
- revive
- gomnd
- mnd
- goprintffuncname
- gosec
- gosimple
Expand All @@ -163,7 +160,7 @@ linters:
- misspell
- nakedret
- nolintlint
- exportloopref
- copyloopvar
- staticcheck
- stylecheck
- typecheck
Expand Down Expand Up @@ -199,4 +196,4 @@ issues:
text: "unnecessaryDefer:"
run:
timeout: 10m
go: '1.22'
go: '1.23'
2 changes: 1 addition & 1 deletion config/.golangci-plugin-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ issues:

run:
timeout: 10m
go: '1.20'
go: '1.23'
23 changes: 10 additions & 13 deletions config/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,14 @@ linters-settings:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
mnd:
checks:
- argument
- case
- condition
- return
govet:
check-shadowing: true
shadow: true
lll:
line-length: 140
maligned:
Expand Down Expand Up @@ -158,7 +155,7 @@ linters:
- gofmt
- goimports
- revive
- gomnd
- mnd
- goprintffuncname
- gosec
- gosimple
Expand All @@ -168,7 +165,7 @@ linters:
- misspell
- nakedret
- nolintlint
- exportloopref
- copyloopvar
- staticcheck
- stylecheck
- typecheck
Expand Down Expand Up @@ -206,4 +203,4 @@ issues:

run:
timeout: 10m
go: '1.22'
go: '1.23'
7 changes: 5 additions & 2 deletions docker/docker-compose-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

cd /app

go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2

go build --buildmode plugin -o /tmp/cerrl.so plugin/cerrl.go

cat config/.golangci.yml | sed "s/path: ..\/cerrl.so/path: \/tmp\/cerrl.so/g" > /tmp/.golangci.yml

# To get the version of a specific library
golangci-lint version --debug | grep "golang.org/x/tools"

golangci-lint run -v --config /tmp/.golangci.yml

rm /tmp/cerrl.so
rm /tmp/cerrl.so
2 changes: 1 addition & 1 deletion docker/docker-compose-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
golangci-lint-docker-compose:
image: golang:1.22
image: golang:1.23
container_name: golangci-lint-docker-compose
volumes:
- ..:/app
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/edenlabllc/go-lint-cerrl

go 1.22
go 1.23

require golang.org/x/tools v0.22.0
require golang.org/x/tools v0.27.0

require (
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/sync v0.10.0 // indirect
)
14 changes: 8 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=

0 comments on commit 6fe1f6a

Please sign in to comment.