diff --git a/.github/workflows/golang-lint.yml b/.github/workflows/golang-lint.yml new file mode 100644 index 0000000..c61eff7 --- /dev/null +++ b/.github/workflows/golang-lint.yml @@ -0,0 +1,26 @@ +name: Lint Golang +on: + push: + branches: + - main + - dev + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + golangci: + name: lint + runs-on: self-hosted + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 + with: + go-version: 1.25.0 + - name: golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.5.0 + args: '--config=${{ github.workspace }}/.golangci.yml' diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..d197cfb --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,27 @@ +version: "2" + +run: + relative-path-mode: gomod + timeout: 5m + +linters: + settings: + dupl: + threshold: 100 + enable: + - errcheck + - govet + - ineffassign + - staticcheck + - unused + - errname + - dupl + - decorder + - cyclop + - funlen + - lll + - nestif + - nlreturn + - prealloc + - tagalign + - whitespace \ No newline at end of file