diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1b77b1e..eb6be43 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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') }} @@ -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 @@ -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 diff --git a/config/.golangci-no-plugin.yml b/config/.golangci-no-plugin.yml index a88b4ec..7625191 100644 --- a/config/.golangci-no-plugin.yml +++ b/config/.golangci-no-plugin.yml @@ -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: @@ -153,7 +150,7 @@ linters: - gofmt - goimports - revive - - gomnd + - mnd - goprintffuncname - gosec - gosimple @@ -163,7 +160,7 @@ linters: - misspell - nakedret - nolintlint - - exportloopref + - copyloopvar - staticcheck - stylecheck - typecheck @@ -199,4 +196,4 @@ issues: text: "unnecessaryDefer:" run: timeout: 10m - go: '1.22' + go: '1.23' diff --git a/config/.golangci-plugin-only.yml b/config/.golangci-plugin-only.yml index 15b127b..8f37e27 100644 --- a/config/.golangci-plugin-only.yml +++ b/config/.golangci-plugin-only.yml @@ -20,4 +20,4 @@ issues: run: timeout: 10m - go: '1.20' + go: '1.23' diff --git a/config/.golangci.yml b/config/.golangci.yml index 2bf6229..2f3b839 100644 --- a/config/.golangci.yml +++ b/config/.golangci.yml @@ -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: @@ -158,7 +155,7 @@ linters: - gofmt - goimports - revive - - gomnd + - mnd - goprintffuncname - gosec - gosimple @@ -168,7 +165,7 @@ linters: - misspell - nakedret - nolintlint - - exportloopref + - copyloopvar - staticcheck - stylecheck - typecheck @@ -206,4 +203,4 @@ issues: run: timeout: 10m - go: '1.22' + go: '1.23' diff --git a/docker/docker-compose-lint.sh b/docker/docker-compose-lint.sh index b70021a..7e39d1a 100644 --- a/docker/docker-compose-lint.sh +++ b/docker/docker-compose-lint.sh @@ -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 \ No newline at end of file +rm /tmp/cerrl.so diff --git a/docker/docker-compose-lint.yaml b/docker/docker-compose-lint.yaml index 7e3f02d..76406ed 100644 --- a/docker/docker-compose-lint.yaml +++ b/docker/docker-compose-lint.yaml @@ -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 diff --git a/go.mod b/go.mod index 12278a5..31e7b8e 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 16f2f69..437ffe7 100644 --- a/go.sum +++ b/go.sum @@ -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=