@@ -16,7 +16,7 @@ Otherwise, some linters have dedicated configuration to exclude or disable rules
16
16
17
17
An example with ` staticcheck ` :
18
18
19
- ``` yml
19
+ ``` yaml
20
20
linters-settings :
21
21
staticcheck :
22
22
checks :
@@ -35,7 +35,7 @@ Also, you can use `issues.exclude-rules` config option for per-path or per-linte
35
35
36
36
In the following example, all the reports that contains the sentences defined in `exclude` are excluded :
37
37
38
- ` ` ` yml
38
+ ` ` ` yaml
39
39
issues:
40
40
exclude:
41
41
- "Error return value of .((os\\ .)?std(out|err)\\ ..*|.*Close|.*Flush|os\\ .Remove(All)?|.*printf?|os\\ .(Un)?Setenv). is not checked"
@@ -45,7 +45,7 @@ issues:
45
45
46
46
In the following example, all the reports from the linters (`linters`) that contains the text (`text`) are excluded :
47
47
48
- ` ` ` yml
48
+ ` ` ` yaml
49
49
issues:
50
50
exclude-rules:
51
51
- linters:
@@ -55,7 +55,7 @@ issues:
55
55
56
56
In the following example, all the reports from the linters (`linters`) that originated from the source (`source`) are excluded :
57
57
58
- ` ` ` yml
58
+ ` ` ` yaml
59
59
issues:
60
60
exclude-rules:
61
61
- linters:
@@ -65,7 +65,7 @@ issues:
65
65
66
66
In the following example, all the reports that contains the text (`text`) in the path (`path`) are excluded :
67
67
68
- ` ` ` yml
68
+ ` ` ` yaml
69
69
issues:
70
70
exclude-rules:
71
71
- path: path/to/a/file.go
@@ -82,7 +82,7 @@ the `--path-prefix` parameter can be used to extend the paths before matching.
82
82
83
83
In the following example, all the reports from the linters (` linters ` ) that concerns the path (` path ` ) are excluded:
84
84
85
- ``` yml
85
+ ``` yaml
86
86
issues :
87
87
exclude-rules :
88
88
- path : ' (.+)_test\.go'
@@ -94,7 +94,7 @@ issues:
94
94
The opposite, excluding reports **except** for specific paths, is also possible.
95
95
In the following example, only test files get checked:
96
96
97
- ` ` ` yml
97
+ ` ` ` yaml
98
98
issues :
99
99
exclude-rules :
100
100
- path-except : ' (.+)_test\.go'
@@ -105,15 +105,15 @@ issues:
105
105
106
106
In the following example, all the reports related to the files (` exclude-files`) are excluded:
107
107
108
- ` ` ` yml
108
+ ` ` ` yaml
109
109
issues:
110
110
exclude-files:
111
111
- path/to/a/file.go
112
112
` ` `
113
113
114
114
In the following example, all the reports related to the directories (`exclude-dirs`) are excluded :
115
115
116
- ` ` ` yml
116
+ ` ` ` yaml
117
117
issues:
118
118
exclude-dirs:
119
119
- path/to/a/dir/
@@ -174,18 +174,3 @@ Use `//nolint` instead of `// nolint` because machine-readable comments should h
174
174
Some exclusions are considered common. To help golangci-lint users those common exclusions are provided through presets.
175
175
176
176
{.ExclusionPresets}
177
-
178
- # ## Default Directory Exclusions
179
-
180
- By default, the reports from directory names, that match the following regular expressions, are excluded :
181
-
182
- - ` third_party$`
183
- - ` examples$`
184
- - ` Godeps$`
185
- - ` builtin$`
186
-
187
- This option has been defined when Go modules was not existed and when the golangci-lint core was different, this is not something we still recommend.
188
-
189
- At some point, we will remove all those obsolete exclusions, but as it's a breaking changes it will only happen inside a major version.
190
-
191
- So we recommend setting `issues.exclude-dirs-use-default` to `false`.
0 commit comments