diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..39f0045 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,31 @@ +name: Lint +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: stable + + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.1 + # Show only new issues until the entire repository + # is compliant with the new linting rules. + only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..6f9b7b0 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,23 @@ +# Configuration of formatting and linting using https://golangci-lint.run/. +version: "2" + +linters: + default: none + enable: + - errcheck + - govet + - ineffassign + - staticcheck + - unused + +formatters: + enable: + - gofmt + - goimports + +issues: + # Show only new issues created after the introduction of the linter. + new-from-rev: ea5ac7e13561f6334938261321e13a725d1c0180 + + # Show issues in any part of update files (requires new-from-rev or new-from-patch). + whole-files: true