Skip to content

Commit

Permalink
Add only-new-issues to ci-lint-go by default (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
chudilka1 authored Oct 22, 2024
1 parent 5f4a9c9 commit 2ac9d97
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/hip-waves-punch.md
Original file line number Diff line number Diff line change
@@ -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.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions actions/ci-lint-go/README.md
Original file line number Diff line number Diff line change
@@ -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
```
5 changes: 5 additions & 0 deletions actions/ci-lint-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 2ac9d97

Please sign in to comment.