diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1225145 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint + +on: + pull_request: + branches: + - canary + +permissions: + contents: read + +jobs: + golangci-lint: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25.4' + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v7 + with: + version: latest diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..4d7131f --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,38 @@ +version: "2" + +linters: + default: standard + enable: + - gocritic + - revive + - misspell + - unconvert + - unparam + - errorlint + settings: + errcheck: + check-type-assertions: true + govet: + enable-all: true + disable: + - fieldalignment + gocritic: + enabled-tags: + - diagnostic + - style + - performance + revive: + rules: + - name: blank-imports + - name: exported + - name: unreachable-code + - name: unused-parameter + exclusions: + presets: + - std-error-handling + rules: + - path: '(.+)_test\.go' + linters: + - errcheck + - text: 'unused-parameter' + source: 'cobra\.Command'