style: clear the six findings the working lint gate reports #3419
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Golang Linter | |
| # Lint runs golangci-lint over the entire Tendermint repository. | |
| # | |
| # This workflow is run on every pull request and push to master. | |
| # | |
| # The `golangci` job will pass without running if no *.{go, mod, sum} | |
| # files have been modified. | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - v[0-9]+.[0-9]+-dev | |
| jobs: | |
| golangci: | |
| name: golangci-lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| CGO_LDFLAGS: "-L/usr/local/lib -ldashbls -lrelic_s -lmimalloc-secure -lgmp" | |
| CGO_CXXFLAGS: "-I/usr/local/include" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| # golangci-lint-action runs with only-new-issues, which diffs the | |
| # branch against its base to decide which findings are new. A shallow | |
| # clone leaves it nothing to diff against, so it falls back to | |
| # reporting every pre-existing issue in the repository. | |
| fetch-depth: 0 | |
| - uses: technote-space/get-diff-action@v6 | |
| with: | |
| PATTERNS: | | |
| **/**.go | |
| .github/linters/* | |
| FILES: | | |
| go.mod | |
| go.sum | |
| .golangci.yml | |
| - uses: actions/setup-go@v7.0.0 | |
| if: env.GIT_DIFF | |
| with: | |
| go-version: "^1.26.5" | |
| - name: Install dependencies | |
| if: env.GIT_DIFF | |
| run: sudo apt-get update && sudo apt-get install -y libpcap-dev | |
| - uses: ./.github/actions/bls | |
| if: env.GIT_DIFF | |
| name: Install BLS library | |
| - uses: golangci/golangci-lint-action@v9.3.0 | |
| if: env.GIT_DIFF | |
| with: | |
| # Required: the version of golangci-lint is required and | |
| # must be specified without patch version: we always use the | |
| # latest patch version. | |
| version: v2.12 | |
| # only-new-issues filters against a patch the action assembles itself, | |
| # which it fails to do for a branch with a large diff — it then falls | |
| # back to reporting every pre-existing issue in the repository. Ask | |
| # the linter to do the filtering directly against the base branch, | |
| # which the full-depth checkout above guarantees is present. | |
| args: >- | |
| --timeout 10m | |
| ${{ github.event_name == 'pull_request' && format('--new-from-rev=origin/{0}', github.base_ref) || '' }} | |
| github-token: ${{ secrets.github_token }} | |
| # The action refuses --new-* args while only-new-issues is set, so the | |
| # two are mutually exclusive: pull requests filter via --new-from-rev | |
| # above, and pushes keep the action's own filtering. | |
| only-new-issues: ${{ github.event_name != 'pull_request' }} |