feat: linting
Some checks failed
Sample Testing / my_job (push) Failing after 48s
CI / lint (push) Failing after 1m49s
CI / release (push) Failing after 2m55s

This commit is contained in:
Marcel S. Henselin 2026-04-17 16:09:15 +02:00
parent 0414cf6dfb
commit 5b938091d7
2 changed files with 103 additions and 7 deletions

View file

@ -16,11 +16,16 @@ jobs:
lint:
runs-on: stackit-docker
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: CI checkout
uses: actions/checkout@v6
- name: Setup GO
uses: actions/setup-go@v6
with:
go-version: 1.26
- uses: golangci/golangci-lint-action@v3
- name: GO Linting
uses: golangci/golangci-lint-action@v3
# build:
# runs-on: stackit-docker
@ -40,9 +45,11 @@ jobs:
runs-on: stackit-docker
# needs: build
steps:
- uses: actions/checkout@v6
- name: Checkout code
uses: actions/checkout@v6
- uses: go-semantic-release/action@v1
- name: Semantic Release
uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ env.FORGEJO_TOKEN }}
@ -51,8 +58,7 @@ jobs:
changelog-file: CHANGELOG.md
changelog-generator-opt: "emojis=true"
-
name: Login to Docker Hub
- name: Login to Docker Hub
if: steps.semrel.outputs.version != ''
uses: docker/login-action@v4
with:

90
.golang-ci.yaml Normal file
View file

@ -0,0 +1,90 @@
version: "2"
run:
concurrency: 4
output:
formats:
text:
print-linter-name: true
print-issued-lines: true
colors: true
path: stdout
linters:
enable:
- bodyclose
- depguard
- errorlint
- forcetypeassert
- gochecknoinits
- gocritic
- gosec
- misspell
- nakedret
- revive
- sqlclosecheck
- wastedassign
disable:
- noctx
- unparam
settings:
depguard:
rules:
main:
list-mode: original
allow: []
deny:
- pkg: github.com/stretchr/testify
desc: Do not use a testing framework
gocritic:
disabled-checks:
- wrapperFunc
- typeDefFirst
- ifElseChain
- dupImport
- hugeParam
enabled-tags:
- performance
- style
- experimental
gosec:
excludes:
- G104
- G102
- G304
- G307
misspell:
locale: US
nakedret:
max-func-lines: 0
revive:
severity: error
rules:
- name: errorf
- name: context-as-argument
- name: error-return
- name: increment-decrement
- name: indent-error-flow
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: atomic
- name: empty-lines
- name: early-return
exclusions:
paths:
- generator/
- internal/testutils
generated: lax
warn-unused: true
# Excluding configuration per-path, per-linter, per-text and per-source.
rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gochecknoinits
formatters:
enable:
- gofmt
- goimports
# settings:
# goimports:
# local-prefixes: