From 67990c5c662be5868cea984e82078bdb69e2f503 Mon Sep 17 00:00:00 2001 From: szktkfm Date: Sun, 21 Jan 2024 14:44:56 +0900 Subject: [PATCH] add golangci-lint workflow --- .github/workflows/golangci-lint.yml | 27 +++++++++++++++++++++++++++ .golangci.yaml | 12 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .golangci.yaml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..42fb1fd --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,27 @@ +name: golangci-lint +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + # Require: The version of golangci-lint to use. + # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. + # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. + version: v1.54 diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..654960d --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,12 @@ +# Options for analysis running. +linters-settings: + # See the dedicated "linters-settings" documentation section. + option: value +linters: + disable-all: true + enable: + - gosimple + - govet + - ineffassign + - staticcheck + - unused