From 3043102e0b7d25af05e98ec581785ff565ef2c3f Mon Sep 17 00:00:00 2001 From: Richard87 Date: Fri, 11 Oct 2024 10:43:50 +0200 Subject: [PATCH] chore: add linting --- .github/workflows/pr.yaml | 28 ++++++++++++++++++++++++++++ .golangci.yaml | 15 +++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/pr.yaml create mode 100644 .golangci.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..96414af --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,28 @@ +name: Pull-Request Testing +on: + pull_request: + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build docker image + run: docker build . + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.61.0 diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..810cb8c --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,15 @@ +run: + timeout: 30m + +linters: + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + - zerologlint + +issues: + max-same-issues: 0 \ No newline at end of file