Skip to content

Instantly share code, notes, and snippets.

@justiandre
Created June 26, 2020 22:06
Show Gist options
  • Save justiandre/ffddd1ddb1c94c33bffd8b7f7f8dc9a7 to your computer and use it in GitHub Desktop.
Save justiandre/ffddd1ddb1c94c33bffd8b7f7f8dc9a7 to your computer and use it in GitHub Desktop.
Lint`s padrão da equipe YMS/UCS
# This file contains all available configuration options
# with their default values.
# options for analysis running
run:
# include test files or not, default is true
tests: false
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
# print lines of code with issue, default is true
print-issued-lines: true
# print linter name in the end of issue text, default is true
print-linter-name: true
# make issues output unique by line, default is true
uniq-by-line: true
# all available settings of specific linters
linters-settings:
dupl:
# tokens count to trigger issue, 150 by default
threshold: 150
errcheck:
# 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: true
funlen:
lines: 25
statements: 40 # https://golang.org/ref/spec#Statements
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
nestif:
# minimal complexity of if statements to report, 5 by default
min-complexity: 2
goconst:
# minimal length of string constant, 3 by default
min-len: 2
# minimal occurrences count to trigger, 3 by default
min-occurrences: 3
godot:
# check all top-level comments, not only declarations
check-all: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gomnd:
settings:
mnd:
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
checks: argument,case,condition,operation,return,assign
excludes: .*test.*
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: 180
testpackage:
# regexp pattern to skip files
skip-regexp: (export|internal)_test\.go
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
whitespace:
multi-if: true # Enforces newlines (or comments) after every multi-line if statement
multi-func: true # Enforces newlines (or comments) after every multi-line function signature
linters:
enable:
- bodyclose
- deadcode
- depguard
- dupl
- errcheck
- funlen
- gocognit
- goconst
- gocritic
- godot
- gofmt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- nakedret
- nestif
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- testpackage
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
disable:
- maligned
- prealloc
disable-all: false
presets:
- bugs
- unused
fast: false
# 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
service:
golangci-lint-version: 1.23.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment