From ee727d0d9cd5fb9dfc620b9493c9c1b8dbeefdb6 Mon Sep 17 00:00:00 2001 From: Azuki-bar <42642269+Azuki-bar@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:25:14 +0900 Subject: [PATCH] add linter --- .github/workflows/test-go.yaml | 24 ++++++++++++++++++++++++ .golangci.yaml | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/test-go.yaml create mode 100644 .golangci.yaml diff --git a/.github/workflows/test-go.yaml b/.github/workflows/test-go.yaml new file mode 100644 index 00000000..77faaa2f --- /dev/null +++ b/.github/workflows/test-go.yaml @@ -0,0 +1,24 @@ +name: Lint and Test golang + + +on: + pull_request: + push: + branches: + - main + - develop + + jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 00000000..e7189369 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,16 @@ +linters: + disable-all: true + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused + - gosec + - godot + - forbidigo + - gocritic + - revive + - gofmt