-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Paul Balogh <[email protected]>
- Loading branch information
Showing
3 changed files
with
151 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
check-modules: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install Go(lang) | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
- name: Check module dependencies | ||
run: | | ||
go version | ||
test -z "$(go mod tidy && git status go.* --porcelain)" | ||
go mod verify | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
- name: Retrieve golangci-lint version | ||
run: | | ||
echo "Version=$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')" >> $GITHUB_OUTPUT | ||
id: version | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ steps.version.outputs.Version }} | ||
only-new-issues: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# v1.55.2 | ||
# Please don't remove the first line. It is used in CI to determine the golangci-lint version. | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _(test|gen)\.go | ||
linters: | ||
- cyclop | ||
- dupl | ||
- gocognit | ||
- funlen | ||
- lll | ||
- path: (cmd|env|migrations)\/ | ||
linters: | ||
- gochecknoglobals | ||
|
||
linters-settings: | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
govet: | ||
check-shadowing: true | ||
cyclop: | ||
max-complexity: 25 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 150 | ||
goconst: | ||
min-len: 10 | ||
min-occurrences: 4 | ||
funlen: | ||
lines: 80 | ||
statements: 60 | ||
forbidigo: | ||
forbid: | ||
- '^(fmt\\.Print(|f|ln)|print|println)$' | ||
# Forbid everything in syscall except the uppercase constants | ||
- '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?' | ||
- '^logrus\.Logger$' | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- contextcheck | ||
- cyclop | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forbidigo | ||
- forcetypeassert | ||
- funlen | ||
- gocheckcompilerdirectives | ||
- gochecknoglobals | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gomoddirectives | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- importas | ||
- ineffassign | ||
- interfacebloat | ||
- lll | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- paralleltest | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- revive | ||
- reassign | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- staticcheck | ||
- stylecheck | ||
- tenv | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
fast: false |