From 96d9f8ad49d94105e921dbe6f900bd4b3c87c73b Mon Sep 17 00:00:00 2001 From: bladehan1 Date: Tue, 7 May 2024 17:55:26 +0800 Subject: [PATCH 1/2] chg: upgrade golangci-lint to 1.57.2 --- .github/workflows/lint.yml | 13 ++++++------- .golangci.yaml | 7 ++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 506a2cf6..90e5e317 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,17 +2,16 @@ name: Lint Check on: [pull_request] jobs: - build: + lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.17 + go-version: '1.22' - name: "Run lint" - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.41 + version: v1.57.2 args: --timeout=10m only-new-issues: true \ No newline at end of file diff --git a/.golangci.yaml b/.golangci.yaml index 348669d1..045be2bc 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -16,9 +16,14 @@ linters: - cyclop - nestif - gocognit + - structcheck + - ifshort + - nosnakecase + - deadcode + - varcheck service: - golangci-lint-version: 1.41 + golangci-lint-version: 1.57.2 run: skip-dirs: From 42e4c276aebc29ac190a362ab26a24470a3577c7 Mon Sep 17 00:00:00 2001 From: bladehan1 Date: Tue, 7 May 2024 18:02:04 +0800 Subject: [PATCH 2/2] chg: update lint config --- .github/workflows/lint.yml | 2 +- .golangci.yaml | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90e5e317..74f2ad39 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.21' - name: "Run lint" uses: golangci/golangci-lint-action@v6 with: diff --git a/.golangci.yaml b/.golangci.yaml index 045be2bc..f859d0cb 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -25,19 +25,16 @@ linters: service: golangci-lint-version: 1.57.2 -run: - skip-dirs: +issues: + new: true + exclude-dirs: - gov/simulation - gov/client - simulation - - skip-files: + exclude-files: - _test.go - "test_.*" -issues: - new: true - linters-settings: errcheck: check-type-assertions: true