.golangci.yml RawHistoryFolder
1version: "2"
2
3linters:
4 default: none
5 enable:
6 - bodyclose # checks whether HTTP response body is closed successfully
7 - copyloopvar # detects places where loop variables are copied
8# - depguard # checks for unwanted dependencies (disabled for CLI apps)
9 - dogsled # checks assignments with too many blank identifiers
10 - dupl # tool for code clone detection
11 - errcheck # checking for unchecked errors
12 - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme
13 - funlen # tool for detection of long functions
14 - gocheckcompilerdirectives # validates go compiler directive comments (//go:)
15# - gochecknoinits # checks that no init functions are present in Go code (disabled for CLI apps)
16 - goconst # finds repeated strings that could be replaced by a constant
17 - gocritic # provides diagnostics that check for bugs, performance and style issues
18 - gocyclo # computes and checks the cyclomatic complexity of functions
19 - godox # tool for detection of FIXME, TODO and other comment keywords
20 - mnd # detects magic numbers
21 - goprintffuncname # checks that printf-like functions are named with `f` at the end
22 - gosec # inspects source code for security problems
23 - govet # examines Go source code and reports suspicious constructs
24 - ineffassign # detects when assignments to existing variables are not used
25 - lll # reports long lines
26 - misspell # finds commonly misspelled English words in comments
27 - nakedret # finds naked returns in functions greater than a specified function length
28 - nolintlint # reports ill-formed or insufficient nolint directives
29 - revive # fast, configurable, extensible, flexible, and beautiful linter for Go
30 - staticcheck # advanced Go linter
31 - testifylint # checks usage of github.com/stretchr/testify
32 - unconvert # removes unnecessary type conversions
33 - unparam # reports unused function parameters
34 - unused # checks for unused constants, variables, functions and types
35 - whitespace # detects leading and trailing whitespace
36
37linters-settings:
38 dupl:
39 threshold: 100
40 funlen:
41 lines: -1 # don't check line count
42 statements: 50
43 goconst:
44 min-len: 2
45 min-occurrences: 3
46 gocritic:
47 enabled-tags:
48 - diagnostic
49 - experimental
50 - opinionated
51 - performance
52 - style
53 disabled-checks:
54 - dupImport
55 - ifElseChain
56 - octalLiteral
57 - whyNoLint
58 gocyclo:
59 min-complexity: 15
60 godox:
61 keywords:
62 - FIXME
63 - TODO
64 - BUG
65 mnd:
66 checks:
67 - argument
68 - case
69 - condition
70 - return
71 ignored-numbers:
72 - '0'
73 - '1'
74 - '2'
75 - '3'
76 ignored-functions:
77 - strings.SplitN
78 govet:
79 enable:
80 - nilness
81 - shadow
82 errorlint:
83 asserts: false
84 lll:
85 line-length: 120
86 misspell:
87 locale: US
88 nolintlint:
89 allow-unused: false
90 require-explanation: true
91 require-specific: true
92 revive:
93 rules:
94 - name: indent-error-flow
95 - name: unused-parameter
96 - name: unused-receiver
97
98issues:
99 exclude-rules:
100 # Exclude some linters from running on tests files
101 - path: _test\.go
102 linters:
103 - dupl
104 - mnd
105 - lll
106 - funlen
107
108 # Exclude SQLC generated files from linting
109 - path: internal/db/.*\.sql\.go
110 linters:
111 - all
112
113 # Exclude SQLC generated models from some linters
114 - path: internal/db/models\.go
115 linters:
116 - unused
117 - deadcode
118
119 # Allow long lines in generated code
120 - path: internal/db/
121 linters:
122 - lll
123
124run:
125 timeout: 5m
126 modules-download-mode: readonly