-
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.
Merge pull request #26 from Clarilab/v3
V3
- Loading branch information
Showing
13 changed files
with
831 additions
and
455 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,326 @@ | ||
linters: | ||
enable-all: true | ||
disable: | ||
- contextcheck # Check whether the function uses a non-inherited context aka context.Background() | ||
- depguard # not needed, does the same as gomodguard | ||
- execinquery # sql linter, no need | ||
- exhaustruct # very annoying, checks if all struct fields are filled | ||
- ginkgolinter # not used libs | ||
- godot # very noisy, don't see the need | ||
- goheader # unused | ||
- gosmopolitan # unnecessary i18n linter | ||
- lll # should be disabled in CI, as this is a cosmetic only and is really shitty on struct fields | ||
- misspell # will sometimes wrongly correct german strings ("Identifikation" -> "Identification", or "Nationalität" -> "Nationalistät", wtf) | ||
- nakedret # no need | ||
- rowserrcheck # disabled because sql | ||
- sqlclosecheck # disabled because of generics | ||
- tagliatelle # no need | ||
- tparallel # does the same as paralleltest | ||
- ireturn # noisy for libs | ||
- interfacebloat # noisy for libs | ||
- varnamelen # very noisy | ||
|
||
linters-settings: | ||
cyclop: | ||
max-complexity: 20 | ||
package-average: 10.0 | ||
skip-tests: true | ||
|
||
dupl: | ||
threshold: 250 | ||
|
||
errcheck: | ||
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`. | ||
# Such cases aren't reported by default. | ||
# Default: false | ||
check-type-assertions: true | ||
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. | ||
# Such cases aren't reported by default. | ||
# Default: false | ||
check-blank: true | ||
|
||
errchkjson: | ||
report-no-exported: true | ||
|
||
exhaustive: | ||
default-signifies-exhaustive: true | ||
|
||
forbidigo: | ||
forbid: | ||
- ^(fmt\.Print(|f|ln)|print|println)$ | ||
- 'http\.Default(Client|Transport)' | ||
|
||
funlen: | ||
lines: 100 # default 60 | ||
statements: 40 | ||
|
||
gocognit: | ||
min-complexity: 20 | ||
|
||
goconst: | ||
min-occurences: 3 | ||
|
||
gocyclo: | ||
min-complexity: 20 | ||
|
||
godot: | ||
exclude: | ||
- "^fixme:" | ||
- "^todo:" | ||
|
||
gofmt: | ||
simplify: false # we use gofumpt for simplification | ||
rewrite-rules: | ||
- pattern: "interface{}" | ||
replacement: "any" | ||
- pattern: "a[b:len(a)]" | ||
replacement: "a[b:]" | ||
- pattern: "a[0:b]" | ||
replacement: "a[:b]" | ||
|
||
gofumpt: | ||
extra-rules: true | ||
|
||
mnd: | ||
# List of function patterns to exclude from analysis. | ||
# Values always ignored: `time.Date`, | ||
# `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`, | ||
# `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`. | ||
# Default: [] | ||
ignored-functions: | ||
- os.Chmod | ||
- os.Mkdir | ||
- os.MkdirAll | ||
- os.OpenFile | ||
- os.WriteFile | ||
- prometheus.ExponentialBuckets | ||
- prometheus.ExponentialBucketsRange | ||
- prometheus.LinearBuckets | ||
|
||
gomodguard: | ||
blocked: | ||
modules: | ||
- github.com/golang/protobuf: | ||
recommendations: | ||
- google.golang.org/protobuf | ||
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules" | ||
- github.com/satori/go.uuid: | ||
recommendations: | ||
- github.com/google/uuid | ||
reason: "we only want to use the google uuid lib for consistency" | ||
- github.com/gofrs/uuid: | ||
recommendations: | ||
- github.com/google/uuid | ||
reason: "we only want to use the google uuid lib for consistency" | ||
- github.com/twinj/uuid: | ||
recommendations: | ||
- github.com/google/uuid | ||
reason: "we only want to use the google uuid lib for consistency" | ||
- github.com/Clarilab/slacklogger: | ||
recommendations: | ||
- github.com/Clarilab/slacklogger/v2 | ||
reason: "we want to update this dependency" | ||
# disabled for now as we are not sure how to deal with this yet | ||
# - github.com/pkg/errors: | ||
# recommendations: | ||
# - stdlib | ||
# reason: 'standard lib provides this functionality, aka fmt.Errorf(...)' | ||
version: | ||
- github.com/savsgio/atreugo/v11: | ||
version: ">11.9.9" | ||
reason: "introduced breaking changes" | ||
|
||
govet: | ||
enable-all: true | ||
disable: # those are pretty noisy for no real benefit | ||
- shadow | ||
- fieldalignment | ||
- loopclosure | ||
|
||
grouper: | ||
import-require-single-import: true | ||
|
||
lll: | ||
line-length: 160 | ||
|
||
nolintlint: | ||
allow-no-explanation: [funlen, lll, wrapcheck] | ||
require-explanation: true | ||
require-specific: true | ||
|
||
nonamedreturns: | ||
report-error-in-defer: true | ||
|
||
paralleltest: | ||
ignore-missing: true # with this setting it will only point out incorrect usage of t.Parallel() | ||
|
||
predeclared: | ||
q: true | ||
|
||
revive: | ||
enable-all-rules: true | ||
rules: | ||
# Provided by mnd linter | ||
- name: add-constant | ||
disabled: true | ||
- name: argument-limit | ||
disabled: true | ||
# Provided by bidichk | ||
- name: banned-characters | ||
disabled: true | ||
- name: bare-return | ||
disabled: true | ||
- name: cognitive-complexity | ||
disabled: true | ||
- name: confusing-results | ||
disabled: true | ||
- name: cyclomatic | ||
disabled: true | ||
- name: early-return | ||
severity: warning | ||
disabled: true | ||
- name: exported | ||
disabled: true | ||
- name: file-header | ||
disabled: true | ||
- name: function-result-limit | ||
disabled: true | ||
- name: function-length | ||
disabled: true | ||
- name: line-length-limit | ||
disabled: true | ||
- name: max-public-structs | ||
disabled: true | ||
- name: modifies-parameter | ||
disabled: true | ||
- name: nested-structs | ||
disabled: true | ||
- name: package-comments | ||
disabled: true | ||
- name: unhandled-error | ||
disabled: true | ||
- name: unused-receiver | ||
disabled: true | ||
|
||
stylecheck: | ||
checks: | ||
- all | ||
- -ST1000 | ||
- -ST1020 | ||
- -ST1021 | ||
- -ST1022 | ||
|
||
tagalign: | ||
align: false | ||
order: | ||
- json | ||
- bson | ||
- validate | ||
|
||
varnamelen: | ||
min-name-length: 2 | ||
ignore-names: | ||
- "i" # loop variable | ||
- "j" # loop variable | ||
- "k" # loop variable | ||
ignore-decls: | ||
- c echo.Context | ||
- t testing.T | ||
- T any | ||
- m map[string]int | ||
|
||
wrapcheck: | ||
# An array of strings that specify globs of packages to ignore. | ||
# Default: [] | ||
ignorePackageGlobs: | ||
- github.com/savsgio/atreugo/* | ||
|
||
wsl: | ||
# Allow declarations (var) to be cuddled. | ||
allow-cuddle-declarations: true | ||
|
||
issues: | ||
fix: true | ||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50. | ||
max-issues-per-linter: 0 | ||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 | ||
exclude-rules: | ||
- source: "^//\\s*go:generate\\s" | ||
linters: | ||
# restrict autofix linters on generated files | ||
- dupword | ||
- godot | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- misspell | ||
- tagalign | ||
- whitespace | ||
- lll | ||
- source: "(noinspection|TODO)" | ||
linters: | ||
- godot | ||
- source: "//noinspection" | ||
linters: | ||
- gocritic | ||
- source: "jsoniter" | ||
linters: | ||
- gochecknoglobals | ||
- path: "_test\\.go" | ||
linters: | ||
- bodyclose | ||
- gochecknoglobals | ||
- containedctx | ||
- cyclop | ||
- dupl | ||
- errcheck | ||
- forbidigo | ||
- funlen | ||
- goconst | ||
- gocyclo | ||
- gosec | ||
- nlreturn | ||
- noctx | ||
- varnamelen | ||
- wrapcheck | ||
|
||
output: | ||
sort-results: true | ||
|
||
run: | ||
exclude-dirs: | ||
- cmd | ||
- config | ||
# tests: false | ||
timeout: 3m | ||
|
||
severity: | ||
default-severity: warning | ||
rules: | ||
- linters: | ||
- asciicheck | ||
- bidichk | ||
- containedctx | ||
- durationcheck | ||
- errchkjson | ||
- errorlint | ||
- exportloopref | ||
- gocheckcompilerdirectives | ||
- gochecknoinits | ||
- goerr113 | ||
- ineffassign | ||
- loggercheck | ||
- makezero | ||
- unused | ||
- unparam | ||
severity: error | ||
- linters: | ||
- dupword | ||
- gci | ||
- goconst | ||
- godot | ||
- gofmt | ||
- goimports | ||
- nakedret | ||
severity: info |
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.