From dd1189e8ad5446806d0124d4dc43b089479dcb67 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sun, 5 Jan 2025 18:36:25 +0100 Subject: [PATCH] Chore: Enable golangci-lint Add a GitHub actions workflow to run golangci-lint. Signed-off-by: SuperQ --- .github/workflows/golangci-lint.yml | 34 +++++++++++++++++++++++++++++ .golangci.yml | 12 ++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..8c828cf --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,34 @@ +--- +name: golangci-lint +on: + push: + paths: + - "go.sum" + - "go.mod" + - "**.go" + - ".github/workflows/golangci-lint.yml" + - ".golangci.yml" + pull_request: + +permissions: # added using https://github.com/step-security/secure-repo + contents: read + +jobs: + golangci: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for golangci/golangci-lint-action to fetch pull requests + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install Go + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + with: + go-version: 1.23.x + - name: Lint + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 + with: + args: --verbose + version: v1.62.0 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..ddf4443 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,12 @@ +--- +linters: + enable: + # - goimports + # - misspell + # - revive + +issues: + exclude-rules: + - path: _test.go + linters: + - errcheck