Change linter file

This commit is contained in:
Andrew Morgan 2019-06-03 00:09:43 +01:00
parent e77f3b7146
commit ab6e15389e
2 changed files with 33 additions and 27 deletions

View file

@ -6,7 +6,7 @@ run:
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 1m
deadline: 30m
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
@ -15,8 +15,8 @@ run:
tests: true
# list of build tags, all linters use it. Default is empty list.
build-tags:
- mytag
#build-tags:
# - mytag
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
@ -24,16 +24,16 @@ run:
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- src/external_libs
- autogenerated_by_my_lib
- bin
- docs
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*\\.my\\.go$"
- lib/bad.go
- ".*\\.md$"
- ".*\\.sh$"
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
@ -61,7 +61,7 @@ output:
# all available settings of specific linters
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
@ -72,7 +72,7 @@ linters-settings:
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
#ignore: fmt:.*,io/ioutil:^Read.*
# path to a file containing a list of functions to exclude from checking
# see https://github.com/kisielk/errcheck#excluding-functions for details
@ -98,10 +98,10 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/org/project
#local-prefixes: github.com/org/project
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
min-complexity: 12
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
@ -117,18 +117,18 @@ linters-settings:
list-type: blacklist
include-go-root: false
packages:
- github.com/davecgh/go-spew/spew
# - github.com/davecgh/go-spew/spew
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
ignore-words:
- someword
# - someword
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
line-length: 96
# tab width in spaces. Default to 1.
tab-width: 1
unused:
@ -179,16 +179,26 @@ linters-settings:
linters:
enable:
- megacheck
- errcheck
- staticcheck
- unused
- gosimple
- structcheck
- varcheck
- ineffassign
- deadcode
- typecheck
- gosec
- gocyclo
- goimports
- dupl
- lll
- interfacer
- depguard
enable-all: false
disable:
- maligned
- prealloc
- gosec
- scopelint
disable-all: false
disable-all: true
presets:
- bugs
- unused
fast: false
@ -198,7 +208,7 @@ issues:
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- abcdef
# - abcdef
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:

View file

@ -21,12 +21,8 @@ if [ ${1:-""} = "fast" ]
then args="--fast"
fi
if [ -n "${DENDRITE_LINT_CONCURRENCY:-}" ]
then args="$args --concurrency=$DENDRITE_LINT_CONCURRENCY"
fi
echo "Installing golangci-lint..."
go get github.com/golangci/golangci-lint/cmd/golangci-lint
echo "Looking for lint..."
golangci-lint run $args --deadline 30m
golangci-lint run $args