From 2ac9d97a83a5edded09af7fcf4ea5bce7a4473a4 Mon Sep 17 00:00:00 2001 From: chudilka1 Date: Tue, 22 Oct 2024 17:56:44 +0300 Subject: [PATCH] Add only-new-issues to ci-lint-go by default (#677) --- .changeset/hip-waves-punch.md | 8 ++++++++ .prettierignore | 1 + actions/ci-lint-go/README.md | 21 +++++++++++++++++++++ actions/ci-lint-go/action.yml | 5 +++++ 4 files changed, 35 insertions(+) create mode 100644 .changeset/hip-waves-punch.md diff --git a/.changeset/hip-waves-punch.md b/.changeset/hip-waves-punch.md new file mode 100644 index 00000000..d2e7460c --- /dev/null +++ b/.changeset/hip-waves-punch.md @@ -0,0 +1,8 @@ +--- +"ci-lint-go": minor +--- + +Added `only-new-issues` flag to be set to `true` in golangci-lint (ci-lint-go). +This setting is critical. Without it, we cannot enable new rules without first +resolving outstanding debt. + diff --git a/.prettierignore b/.prettierignore index c0926470..b35c55ed 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,6 +17,7 @@ pnpm-lock.yaml yarn.lock /apps/go-mod-validator/test/__fixtures__/ /.nx/cache +/.changeset/ # Don't LLM format prompt files /actions/llm-pr-writer/pr-writer-prompt.md diff --git a/actions/ci-lint-go/README.md b/actions/ci-lint-go/README.md index b71051b7..a8af0fce 100644 --- a/actions/ci-lint-go/README.md +++ b/actions/ci-lint-go/README.md @@ -1 +1,22 @@ # ci-lint-go + +Example: + +```yaml +name: Golangci-lint + +on: [pull_request] + +jobs: + golangci-lint: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + actions: read + steps: + - name: golangci-lint + uses: smartcontractkit/.github/actions/ci-lint-go@5f5ebd52cb13f4b8530cd3005ec7ec3180840219 # v0.2.5 + with: + go-version-file: go.mod +``` diff --git a/actions/ci-lint-go/action.yml b/actions/ci-lint-go/action.yml index 14c1ffd7..cc43b275 100644 --- a/actions/ci-lint-go/action.yml +++ b/actions/ci-lint-go/action.yml @@ -60,6 +60,10 @@ inputs: description: "" required: false default: --out-format checkstyle:golangci-lint-report.xml + only-new-issues: + description: "Report only the new issues introduced in your code" + required: false + default: "true" go-directory: description: "" default: . @@ -116,6 +120,7 @@ runs: version: ${{ inputs.golangci-lint-version }} args: ${{ inputs.golangci-lint-args }} working-directory: ${{ inputs.go-directory }} + only-new-issues: ${{ inputs.only-new-issues }} - name: Print lint report artifact if: always()