From 2cb8f60ac269a96fd444b753b44b8059a0116e16 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Thu, 17 Apr 2025 11:12:07 +0800 Subject: [PATCH] switch from reviewdog to golangci-lint --- .github/workflows/golangci-lint.yml | 25 +++++++++++++++++++++++++ .github/workflows/reviewdog.yml | 22 ---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml delete mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 00000000..ab269278 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,25 @@ +name: golangci-lint +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v7 + with: + version: v2.0 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml deleted file mode 100644 index 6cc7882b..00000000 --- a/.github/workflows/reviewdog.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: reviewdog -on: [pull_request] -jobs: - golangci-lint: - name: runner / golangci-lint - runs-on: ubuntu-latest - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - - name: golangci-lint - uses: reviewdog/action-golangci-lint@3dfdce20f5ca12d264c214abb993dbb40834da90 # v2.7.2 - - - name: gofumpt -s with reviewdog - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - go install mvdan.cc/gofumpt@v0.2.0 - gofumpt -e -d . | \ - reviewdog -name="gofumpt" -f=diff -f.diff.strip=0 -reporter=github-pr-review