-
Notifications
You must be signed in to change notification settings - Fork 0
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: Cattī Crūdēlēs <[email protected]>
- Loading branch information
Showing
7 changed files
with
276 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest |
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,221 @@ | ||
run: | ||
timeout: 10m | ||
show-stats: true | ||
|
||
output: | ||
sort-results: true | ||
|
||
linters-settings: | ||
cyclop: | ||
max-complexity: 15 | ||
package-average: 10 | ||
skip-tests: true | ||
dupl: | ||
threshold: 120 | ||
errcheck: | ||
exclude-functions: | ||
- encoding/json.Marshal | ||
- encoding/json.MarshalIndent | ||
errchkjson: | ||
check-error-free-encoding: true | ||
report-no-exported: true | ||
exhaustive: | ||
check: | ||
- switch | ||
- map | ||
default-signifies-exhaustive: true | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/rabbitmq/amqp091-go) | ||
- prefix(github.com/wzy9607/amqp091otel) | ||
custom-order: true | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- style | ||
- performance | ||
- experimental | ||
- opinionated | ||
disabled-checks: | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- hugeParam | ||
- ifElseChain | ||
- ruleguard | ||
- sloppyReassign | ||
- whyNoLint | ||
settings: | ||
captLocal: | ||
paramsOnly: false | ||
unnamedResult: | ||
checkExported: true | ||
gofmt: | ||
simplify: false # covered by gofumpt | ||
rewrite-rules: | ||
- pattern: "interface{}" | ||
replacement: "any" | ||
- pattern: "a[b:len(a)]" | ||
replacement: "a[b:]" | ||
gomnd: | ||
checks: | ||
- argument | ||
- case | ||
- condition | ||
- return | ||
ignored-functions: | ||
- strings.SplitN | ||
govet: | ||
check-shadowing: true | ||
enable-all: true | ||
disable: | ||
- fieldalignment | ||
grouper: | ||
import-require-single-import: true | ||
nakedret: | ||
max-func-lines: 50 | ||
nolintlint: | ||
allow-unused: false | ||
require-explanation: true | ||
require-specific: true | ||
revive: | ||
rules: | ||
- name: argument-limit | ||
arguments: | ||
- 8 | ||
- name: atomic | ||
- name: bool-literal-in-expr | ||
- name: confusing-results | ||
- name: constant-logical-expr | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: datarace | ||
- name: defer | ||
- name: error-naming | ||
- name: error-return | ||
arguments: | ||
- "preserveScope" | ||
- name: errorf | ||
- name: increment-decrement | ||
- name: indent-error-flow | ||
- name: modifies-value-receiver | ||
- name: optimize-operands-order | ||
- name: redundant-import-alias | ||
- name: string-of-int | ||
- name: struct-tag | ||
- name: superfluous-else | ||
- name: time-equal | ||
- name: time-naming | ||
- name: var-naming | ||
stylecheck: | ||
checks: | ||
- "all" | ||
- "-ST1000" | ||
usestdlibvars: | ||
http-method: true | ||
http-status-code: true | ||
time-weekday: true | ||
time-month: true | ||
time-layout: true | ||
crypto-hash: true | ||
default-rpc-path: true | ||
os-dev-null: true | ||
sql-isolation-level: true | ||
tls-signature-scheme: true | ||
constant-kind: true | ||
syslog-priority: true | ||
varnamelen: | ||
max-distance: 10 | ||
|
||
linters: | ||
enable: | ||
- asasalint | ||
- bidichk | ||
- bodyclose | ||
- containedctx | ||
- contextcheck | ||
- cyclop | ||
- dupl | ||
- dupword | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exhaustruct | ||
- forbidigo | ||
- forcetypeassert | ||
- funlen | ||
- gci | ||
- gocheckcompilerdirectives | ||
- gochecksumtype | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- gomnd | ||
- gomoddirectives | ||
- gosec | ||
- gosimple | ||
- govet | ||
- grouper | ||
- inamedparam | ||
- ineffassign | ||
- interfacebloat | ||
- lll | ||
- maintidx | ||
- makezero | ||
- mirror | ||
- misspell | ||
- musttag | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- paralleltest | ||
- perfsprint | ||
- predeclared | ||
- reassign | ||
- revive | ||
- spancheck | ||
- staticcheck | ||
- stylecheck | ||
- tagalign | ||
- tenv | ||
- testifylint | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- usestdlibvars | ||
- varnamelen | ||
- wastedassign | ||
- whitespace | ||
|
||
|
||
issues: | ||
include: | ||
- EXC0003 | ||
- EXC0004 | ||
- EXC0005 | ||
- EXC0006 | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- containedctx | ||
- dupl | ||
- exhaustive | ||
- exhaustruct | ||
- forcetypeassert | ||
- funlen | ||
- gomnd | ||
- nakedret | ||
- varnamelen | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 |
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
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
Oops, something went wrong.