diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..8115d29 --- /dev/null +++ b/.github/workflows/lint.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: golangci-lint + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + - name: golangci-lint + uses: reviewdog/action-golangci-lint@v2 + with: + # optionally use a specific version of Go rather than the latest one + go_version: "1.18" + + # Can pass --config flag to change golangci-lint behavior and target + # directory. + # golangci_lint_flags: "--config=.github/.golangci.yml ./testdata" + # workdir: subdirectory/ + + # Use golint via golangci-lint binary with "warning" level. + golint: + name: golint + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + - name: golint + uses: reviewdog/action-golangci-lint@v2 + with: + go_version: "1.18" + 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: errcheck + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + - name: errcheck + uses: reviewdog/action-golangci-lint@v2 + with: + go_version: "1.18" + golangci_lint_flags: "--disable-all -E errcheck" + tool_name: errcheck + level: info