rclone/vendor/storj.io/drpc/.golangci.yml

130 lines
5.1 KiB
YAML
Raw Normal View History

2020-05-11 18:57:46 +00:00
run:
deadline: 10m
issues-exit-code: 1
tests: true
skip-files:
- ".*\\.pb\\.go$"
- ".*\\.dbx\\.go$"
linters:
enable:
- govet # check standard vet rules
- golint # check standard linting rules
- staticcheck # comprehensive checks
- errcheck # find unchecked errors
- ineffassign # find ineffective assignments
- varcheck # find unused global variables and constants
- structcheck # check for unused struct parameters
- deadcode # find code that is not used
- bodyclose # find unclosed http response bodies
- nakedret # check for naked returns
- gofmt # sanity check formatting
- misspell # check spelling
- unconvert # remove unnecessary conversions
- scopelint # checks for unpinned variables
- gocritic # checks for style, performance issues, and common programming errors
- dogsled # checks for too many ignored arguments
- goprintffuncname # Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false]
- gosec
#TODO#- whitespace # checks for leading/trailing newlines
#TODO#- unparam # check for unused parameters
#TODO#- maligned # check for better memory usage
#TODO#- prealloc # easy optimizations
disable:
- godox
- wsl # too much noise
- goimports # disabled, because it's slow, using scripts/check-imports.go instead.
- goconst # check for things that could be replaced by constants
- gocyclo # needs tweaking
- depguard # unused
- stylecheck # has false positives
- dupl # slow
- interfacer # not that useful
- gosimple # part of staticcheck
- unused # part of staticcheck
- lll
- rowserrcheck # checks if sql.Rows.Err is checked correctly - Disabled because it reports false positive with defer statements after Query call
fast: false
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
govet:
# report about shadowed variables
#TODO# check-shadowing: true
# Obtain type information from installed (to $GOPATH/pkg) package files:
# golangci-lint will execute `go install -i` and `go test -i` for analyzed packages
# before analyzing them.
# Enable this option only if all conditions are met:
# 1. you use only "fast" linters (--fast e.g.): no program loading occurs
# 2. you use go >= 1.10
# 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI.
use-installed-packages: false
gocritic:
disabled-checks:
- ifElseChain
goimports:
local: "storj.io"
golint:
min-confidence: 0.8
gofmt:
simplify: true
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 150
goconst:
min-len: 3
min-occurrences: 3
misspell:
lll:
line-length: 140
tab-width: 1
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
unparam:
# call graph construction algorithm (cha, rta). In general, use cha for libraries,
# and rta for programs with main packages. Default is cha.
algo: cha
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
prealloc:
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
# True by default.
simple: true
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: false # Report preallocation suggestions on for loops, false by default
issues:
max-issues-per-linter: 0
max-same-issues: 0
new: false
exclude-use-default: false