From 990ce52152a99be39cb87add809f8c143f7aaf69 Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Tue, 4 Feb 2025 12:51:12 +0100 Subject: [PATCH 1/2] chore(lint): set `new-from-rev` to base libevm commit hash --- .github/workflows/golangci-lint.yml | 2 ++ .golangci.yml | 32 +---------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fc1968ed4877..c0333653096e 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,6 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # required for new-from-rev option to work - uses: actions/setup-go@v5 with: go-version: stable diff --git a/.golangci.yml b/.golangci.yml index 1bd8c0c69024..513d8d1b04b3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -78,38 +78,8 @@ linters-settings: disabled: true issues: + new-from-rev: 0b56af5a01b8a0c6fc9d60247bb79ffd03d1bcfd exclude-dirs-use-default: false - exclude-rules: - - path-except: libevm - linters: - # If any issue is flagged in a non-libevm file, add the linter here - # because the problem isn't under our control. - - containedctx - - forcetypeassert - - errcheck - - gci - - gofmt - - goheader - - goimports - - gosec - - gosimple - - govet - - nakedret - - nestif - - nilerr - - nolintlint - - revive - - staticcheck - - tagliatelle - - testableexamples - - testifylint - - thelper - - tparallel - - typecheck - - usestdlibvars - - varnamelen - - wastedassign - - whitespace include: # Many of the default exclusions are because, verbatim "Annoying issue", # which defeats the point of a linter. From a7e8b80a053cb96cd95ba2b19b0a317e5463ef8e Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Tue, 4 Feb 2025 12:51:42 +0100 Subject: [PATCH 2/2] chore(ci): update linter `new-from-rev` in rename-module workflow --- .github/workflows/rename-module.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/rename-module.yml b/.github/workflows/rename-module.yml index 2d74418cd614..058855418b77 100644 --- a/.github/workflows/rename-module.yml +++ b/.github/workflows/rename-module.yml @@ -75,3 +75,29 @@ jobs: commit_message: "[AUTO] rename Go module + update internal import paths\n\nWorkflow: ${{ steps.vars.outputs.WORKFLOW_HASH }} on branch ${{ github.ref_name }}" repo: ${{ github.repository }} branch: ${{ steps.vars.outputs.DEST_BRANCH }} + + update-golangci: + runs-on: ubuntu-latest + needs: rename-module + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.rename-module.outputs.vars.DEST_BRANCH }} + depth: 1 + + - name: Update .golangci.yml new-from-rev + uses: fjogeleit/yaml-update-action@main + with: + valueFile: ".golangci.yml" + propertyPath: "issues.new-from-rev" + value: $(git rev-parse HEAD) + commitChange: false + + - name: Signed commit to branch + uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5 # v0.2.0 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + commit_message: "[AUTO] update .golangci.yml new-from-rev" + repo: ${{ github.repository }} + branch: ${{ needs.rename-module.outputs.vars.DEST_BRANCH }}