@@ -14,93 +14,92 @@ var DefaultExcludePatterns = []ExcludePattern{
14
14
Pattern : "Error return value of .((os\\ .)?std(out|err)\\ ..*|.*Close" +
15
15
"|.*Flush|os\\ .Remove(All)?|.*print(f|ln)?|os\\ .(Un)?Setenv). is not checked" ,
16
16
Linter : "errcheck" ,
17
- Why : "Almost all programs ignore errors on these functions and in most cases it's ok" ,
17
+ Why : "Almost all programs ignore errors on these functions and in most cases it's ok. " ,
18
18
},
19
19
{
20
- ID : "EXC0002" ,
20
+ ID : "EXC0002" , // TODO(ldez): should be remove in v2
21
21
Pattern : "(comment on exported (method|function|type|const)|" +
22
22
"should have( a package)? comment|comment should be of the form)" ,
23
23
Linter : "golint" ,
24
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
24
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments. " ,
25
25
},
26
26
{
27
- ID : "EXC0003" ,
27
+ ID : "EXC0003" , // TODO(ldez): should be remove in v2
28
28
Pattern : "func name will be used as test\\ .Test.* by other packages, and that stutters; consider calling this" ,
29
29
Linter : "golint" ,
30
- Why : "False positive when tests are defined in package 'test'" ,
30
+ Why : "False positive when tests are defined in package 'test'. " ,
31
31
},
32
32
{
33
33
ID : "EXC0004" ,
34
34
Pattern : "(possible misuse of unsafe.Pointer|should have signature)" ,
35
35
Linter : "govet" ,
36
- Why : "Common false positives" ,
36
+ Why : "Common false positives. " ,
37
37
},
38
38
{
39
39
ID : "EXC0005" ,
40
- Pattern : "ineffective break statement. Did you mean to break out of the outer loop" ,
40
+ Pattern : "SA4011" , // CheckScopedBreak
41
41
Linter : "staticcheck" ,
42
- Why : "Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore" ,
42
+ Why : "Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore. " ,
43
43
},
44
44
{
45
45
ID : "EXC0006" ,
46
- Pattern : "Use of unsafe calls should be audited" ,
46
+ Pattern : "G103: Use of unsafe calls should be audited" ,
47
47
Linter : "gosec" ,
48
- Why : "Too many false-positives on 'unsafe' usage" ,
48
+ Why : "Too many false-positives on 'unsafe' usage. " ,
49
49
},
50
50
{
51
51
ID : "EXC0007" ,
52
- Pattern : "Subprocess launch(ed with variable|ing should be audited) " ,
52
+ Pattern : "G204: Subprocess launched with variable" ,
53
53
Linter : "gosec" ,
54
- Why : "Too many false-positives for parametrized shell calls" ,
54
+ Why : "Too many false-positives for parametrized shell calls. " ,
55
55
},
56
56
{
57
57
ID : "EXC0008" ,
58
- Pattern : "( G104)" ,
58
+ Pattern : "G104" , // Errors unhandled.
59
59
Linter : "gosec" ,
60
- Why : "Duplicated errcheck checks" ,
60
+ Why : "Duplicated errcheck checks. " ,
61
61
},
62
62
{
63
63
ID : "EXC0009" ,
64
- Pattern : "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) " ,
64
+ Pattern : "(G301|G302|G307): Expect ( directory permissions to be 0750| file permissions to be 0600) or less" ,
65
65
Linter : "gosec" ,
66
- Why : "Too many issues in popular repos" ,
66
+ Why : "Too many issues in popular repos. " ,
67
67
},
68
68
{
69
69
ID : "EXC0010" ,
70
- Pattern : "Potential file inclusion via variable" ,
70
+ Pattern : "G304: Potential file inclusion via variable" ,
71
71
Linter : "gosec" ,
72
- Why : "False positive is triggered by 'src, err := ioutil.ReadFile(filename)'" ,
72
+ Why : "False positive is triggered by 'src, err := ioutil.ReadFile(filename)'. " ,
73
73
},
74
74
{
75
- ID : "EXC0011" ,
76
- Pattern : "(comment on exported (method|function|type|const)|" +
77
- "should have( a package)? comment|comment should be of the form)" ,
78
- Linter : "stylecheck" ,
79
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
75
+ ID : "EXC0011" ,
76
+ Pattern : "(ST1000|ST1020|ST1021|ST1022)" , // CheckPackageComment, CheckExportedFunctionDocs, CheckExportedTypeDocs, CheckExportedVarDocs
77
+ Linter : "stylecheck" ,
78
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments." ,
80
79
},
81
80
{
82
81
ID : "EXC0012" ,
83
- Pattern : `exported (.+) should have comment( \(or a comment on this block\))? or be unexported` ,
82
+ Pattern : `exported (.+) should have comment( \(or a comment on this block\))? or be unexported` , // rule: exported
84
83
Linter : "revive" ,
85
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
84
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments. " ,
86
85
},
87
86
{
88
87
ID : "EXC0013" ,
89
- Pattern : `package comment should be of the form "(.+)...` ,
88
+ Pattern : `package comment should be of the form "(.+)..."` , // rule: package-comments
90
89
Linter : "revive" ,
91
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
90
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments. " ,
92
91
},
93
92
{
94
93
ID : "EXC0014" ,
95
- Pattern : `comment on exported (.+) should be of the form "(.+)..."` ,
94
+ Pattern : `comment on exported (.+) should be of the form "(.+)..."` , // rule: exported
96
95
Linter : "revive" ,
97
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
96
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments. " ,
98
97
},
99
98
{
100
99
ID : "EXC0015" ,
101
- Pattern : `should have a package comment` ,
100
+ Pattern : `should have a package comment` , // rule: package-comments
102
101
Linter : "revive" ,
103
- Why : "Annoying issue about not having a comment. The rare codebase has such comments" ,
102
+ Why : "Annoying issue about not having a comment. The rare codebase has such comments. " ,
104
103
},
105
104
}
106
105
0 commit comments