From 69139ee7f6986fb6f32bca0c28d6810a08b862f0 Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Sun, 5 Apr 2020 18:59:05 -0400 Subject: [PATCH] Add reviewdog golangci-lint --- .github/workflows/reviewdog.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 0000000..35c095e --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,52 @@ +name: reviewdog +on: [pull_request] +jobs: + # NOTE: golangci-lint doesn't report multiple errors on the same line from + # different linters and just report one of the errors? + + golangci-lint: + name: runner / golangci-lint + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + - name: golangci-lint + uses: docker://reviewdog/action-golangci-lint:v1 # Pre-built image + # uses: reviewdog/action-golangci-lint@v1 # Build with Dockerfile + # uses: docker://reviewdog/action-golangci-lint:v1.0.2 # Can use specific version. + # uses: reviewdog/action-golangci-lint@v1.0.2 # Can use specific version. + with: + github_token: ${{ secrets.github_token }} + # Can pass --config flag to change golangci-lint behavior and target + # directory. + golangci_lint_flags: "--config=.github/.golangci.yml ./testdata" + + # Use golint via golangci-lint binary with "warning" level. + golint: + name: runner / golint + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + - name: golint + uses: reviewdog/action-golangci-lint@v1 + with: + github_token: ${{ secrets.github_token }} + golangci_lint_flags: "--disable-all -E golint" + tool_name: golint # Change reporter name. + level: warning # GitHub Status Check won't become failure with this level. + + # You can add more and more supported linters with different config. + errcheck: + name: runner / errcheck + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + - name: errcheck + uses: reviewdog/action-golangci-lint@v1 + with: + github_token: ${{ secrets.github_token }} + golangci_lint_flags: "--disable-all -E errcheck" + tool_name: errcheck + level: info