-
Notifications
You must be signed in to change notification settings - Fork 0
/
gometalinter_rules.csv
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 39.
172 lines (172 loc) · 21.4 KB
/
gometalinter_rules.csv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
规则名称,严重级别,规则说明,规则识别字符串
deadcode/unused,警告,"%s 未使用","\S* is unused"
errcheck/retvalue,提示,"没有检查返回值","error return value not checked"
gochecknoglobals/noglobals,提示,"检查全局变量。全局变量是函数签名、复杂的测试中不可见的函数的输入,会降低了可读性并增加了代码的复杂性。","\S* is a global variable"
gosec/archive,警告,"解压zip时候文件遍历","File traversal when extracting zip archive"
gosec/calls,错误,"审查不安全的调用","Use of unsafe calls should be audited"
gosec/blacklist,错误,"crypto/md5已被列入import的黑名单中","Blacklisted import crypto/md5: weak cryptographic primitive"
gosec/blacklist,错误,"crypto/des已被列入import的黑名单中","Blacklisted import crypto/des: weak cryptographic primitive"
gosec/blacklist,错误,"crypto/rc4已被列入import的黑名单中","Blacklisted import crypto/rc4: weak cryptographic primitive"
gosec/blacklist,错误,"net/http/cgi已被列入import的黑名单中:Go版本低于1.6.3容易受到Httpoxy的攻击:(CVE-2016-5386)","Blacklisted import net/http/cgi: Go versions < 1.6.3 are vulnerable to Httpoxy attack: \(CVE-2016-5386\)"
gosec/blacklist,错误,"crypto/sha1已被列入import的黑名单中","Blacklisted import crypto/sha1: weak cryptographic primitive"
gosec/crypto,错误,"硬编码凭证","Potential hardcoded credentials"
gosec/crypto,错误,"使用弱的数字随机生成器(使用math/rand,而不是crypto/rand)","Use of weak random number generator \(math/rand instead of crypto/rand\)"
gosec/crypto,错误,"RSA Key至少应该有%d位(bits)","RSA keys should be at least \d* bits"
gosec/crypto,错误,"使用了弱的加密方法","Use of weak cryptographic primitive"
gosec/error,错误,"没有处理错误","Errors unhandled"
gosec/escape,错误,"该方法不会自动转义HTML。验证数据格式良好。","this method will not auto-escape HTML. Verify data is well formed."
gosec/file,错误,"在tmp目录创建文件没有使用ioutil.Tempfile","File creation in shared tmp directory without using ioutil.Tempfile"
gosec/modulus,错误,"检查使用math/big.Int.Exp函数时模数是否为0","Use of math/big.Int.Exp function should be audited for modulus == 0"
gosec/network,错误,"绑定了所有网络接口","Binds to all network interfaces"
gosec/permission,错误,"文件至少需要%#o的权限","Expect file permissions to be \d* or less"
gosec/permission,错误,"目录至少需要%#o的权限","Expect directory permissions to be \d* or less"
gosec/sql,错误,"使用了SQL字符拼接","SQL string concatenation"
gosec/sql,错误,"使用了SQL字符格式化","SQL string formatting"
gosec/subproc,警告,"检查子进程的启动","Subprocess launching should be audited"
gosec/subproc,错误,"子进程启动使用了变量参数","Subprocess launched with variable"
gosec/ssrf,错误,"使用变量url进行的潜在HTTP请求","Potential HTTP request made with variable url"
gosec/ssh,错误,"应检查ssh InsecureIgnoreHostKey的使用","Use of ssh InsecureIgnoreHostKey should be audited"
gosec/tls,错误,"TLS Bad Cipher Suite: %s","TLS Bad Cipher Suite: \w*"
gosec/tls,错误,"InsecureSkipVerify设为true","TLS InsecureSkipVerify set true."
gosec/tls,错误,"InsecureSkipVerify可能为true","TLS InsecureSkipVerify may be true."
gosec/tls,错误,"PreferServerCipherSuites设为false","TLS PreferServerCipherSuites set false."
gosec/tls,错误,"PreferServerCipherSuites可能为false","TLS PreferServerCipherSuites may be false."
gosec/tls,错误,"MinVersion太低","TLS MinVersion too low."
gosec/tls,错误,"MinVersion可能太低","TLS MinVersion may be too low."
gosec/tls,错误,"MaxVersion太低","TLS MaxVersion too low."
gosec/tls,错误,"MaxVersion可能太低","TLS MaxVersion may be too low."
gosec/readfile,警告,"变量可能包含文件路径","Potential file inclusion via variable"
goconst/string,警告,"重复使用的字符串应提取为常量:在 %s:%d:%d:%d 也使用了字符串 "%s",文件为: %s","\w*:\d*:\d*:\d* other occurrence\(s\) of "\S*" found in: .*"
gofmt/notformat,提示,"文件没有使用gofmt -s格式化","file is not gofmted with -s"
goimports/notimport,错误,"文件没有被goimport","file is not goimported"
golint/arg-order,提示,"context.Context应该是函数的第一个参数","context\.Context should be the first parameter of a function"
golint/arg-order,提示,"当返回多个值时,错误值应该放到最后","error should be the last type when returning multiple items"
golint/comment,提示,"package注释与声明之间不应该有空行","package comment is detached; there should be no blank lines between it and the package statement"
golint/comment,提示,"package需要写注释","should have a package comment, unless it's in another file for this package"
golint/comment,提示,"package注释开头不应该有空格","package comment should not have leading space"
golint/comment,提示,"package注释应该是该种形式 %s","package comment should be of the form ".*\.\.\.""
golint/comment,提示,"exported类型变量 %v 应该有注释,或者改成非exported类型","exported type \S* should have comment or be unexported"
golint/comment,提示,"在exported类型 %v的注释,形式应该是%v…","comment on exported type \w* should be of the form ".*\.\.\.""
golint/comment,提示,"exported类型 %s %s应该有注释,或者设置为unexported类型","exported \w* \S* should have comment or be unexported"
golint/comment,提示,"在exported类型%s %s的注释,形式应该是%s…","comment on exported \w* \S* should be of the form ".*\.\.\.""
golint/comment,提示,"exported类型%s %s应该有它自己的声明","exported \w* \S* should have its own declaration"
golint/comment,提示,"exported类型 %s %s应该有注释%s,或者设置为unexported类型","exported \w* \S* should have comment.* or be unexported"
golint/zero-value,提示,"应该丢弃 = %s,从变量%s声明中;它的值为0","should drop = \w* from declaration of var \w*; it is the zero value"
golint/type-inference,提示,"可以省略类型%s,因为该类型可以从变量%s的声明语句中的右值推导出来","should omit type \w* from declaration of var \w*; it will be inferred from the right-hand side"
golint/imports,提示,"空的import应只能在main或test package里面,或者使用注释说明","a blank import should be only in a main or test package, or have a comment justifying it"
golint/imports,提示,"不应该使用 . imports 形式","should not use dot imports"
golint/naming,提示,"Go名称不应该使用全部大写,请使用驼峰格式","don't use ALL_CAPS in Go names; use CamelCase"
golint/naming,提示,"Go名称不应该使用k开头;%s %s应该是%s","don't use leading k in Go names; \w* \w* should be \w*"
golint/naming,提示,"Go名称不应该使用下划线;%s %s应该是%s","don't use underscores in Go names; \w* \w* should be \w*"
golint/naming,提示,"%s %s 应该是 %s","^\w* \w* should be \w*$"
golint/naming,提示,"%s 名称会被其他packages以 %s.%s引用,可以考虑这样调用 %s","\w* name will be used as \w*\.\S* by other packages, and that stutters; consider calling this \w*"
golint/naming,提示,"error变量%s应该以%sFoo形式命名","error var \w* should have name of the form \w*Foo"
golint/naming,提示,"receiver名称不应该有下划线,如果是不使用的,可以省略","receiver name should not be an underscore, omit the name if it is unused"
golint/naming,提示,"receiver名称应该是其身份的反射;不要使用this或者self","receiver name should be a reflection of its identity; don't use generic names such as "this" or "self""
golint/naming,提示,"receiver名称%s应该与之前的%s %s保持一致","receiver name \w* should be consistent with previous receiver name \w* for \w*"
golint/naming,提示,"package名称不应该有下划线","don't use an underscore in package name"
golint/mixed-caps,提示,"package名不要使用MixedCaps格式命名;%s应该是%s","don't use MixedCaps in package name; \w* should be \w*"
golint/range-loop,提示,"应该省略range的值;这个循环等效与 `for range ...`","should omit values from range; this loop is equivalent to `for range \.\.\.`"
golint/range-loop,提示,"应该省略range的第二个值;这个循环等效于`for %s %s range ...`","should omit 2nd value from range; this loop is equivalent to `for \S* \S* range \.\.\.`"
golint/print,提示,"%s(fmt.Sprintf(...)) 不符合要求,应该使用 %s.Errorf(...)替换之","should replace \w*\(fmt\.Sprintf(\.\.\.)\) with \w*\.Errorf\(\.\.\.\)"
golint/unary-op,提示,"可以将 %s 写成 %s%s","should replace .* with .*"
golint/indent,提示,"if语块以return语句结束,那么可以删去else分支并将else内的语句移到if语块外","if block ends with a return statement, so drop this else and outdent its block"
golint/unexported-type-in-api,提示,"exported类型 %s %s 返回unexported类型 %s,这会造成使用上的困扰","exported \w* \S* returns unexported type \S*, which can be annoying to use"
golint/string,提示,"错误字符串不应该大写,或者标点符号、新行结尾","error strings should not be capitalized or end with punctuation or a newline"
golint/time,提示,"var %s 是类型 %v,不要使用unit-specific后缀 %q","var \w* is of type \w*; don't use unit-specific suffix \w*"
golint/context,提示,"不应该使用基础类型 %s 作为context.WithValue的key","should not use basic type \w* as key in context\.WithValue"
gosimple/boolcmp,警告,"应该省略bool常量的比较,可以简化为:%s","should omit comparison to bool constant, can be simplified to \w*"
gosimple/copy,警告,"应该使用copy()而不是循环","should use copy\(\) instead of a loop"
gosimple/for,警告,"应该使用for range,而不是 for select{}","should use for range instead of for { select {} }"
gosimple/sendrecv,警告,"应该使用简单通道的send/receive,而不是select","should use a simple channel send/receive instead of select with a single case"
gosimple/usageadvice,警告,"应该使用%v.String()方法而不是%v","should use \w*\.String\(\) instead of \w*"
gosimple/usageadvice,警告,"应该使用%v.Bytes()方法而不是%v","should use \w*\.Bytes\(\) instead of \w*"
gosimple/usageadvice,警告,"应该使用 %s%s.%s(%s)","should use \w*\.\w*\(\w*\) instead"
gosimple/usageadvice,警告,"应该使用%sbytes.Equal(%s)","should use \w*bytes\.Equal\(\w*\) instead"
gosimple/usageadvice,警告,"应该使用 for {} 而不是 for true {}","should use for {} instead of for true {}"
gosimple/usageadvice,警告,"应该使用原生字符串 (`...`)及regexp.%s避免转义两次","should use raw string \(`\.\.\.`\) with regexp\.\w* to avoid having to escape twice"
gosimple/usageadvice,警告,"应该使用 'return ',而不是 'if { return }; return '","should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>'"
gosimple/usageadvice,警告,"应该省略nil检查;%s执行len()定义为0","should omit nil check; len\(\) for \w* is defined as zero"
gosimple/usageadvice,警告,"使用slice时应该省略第二个index,s[a:len(s)] 等效于 s[a:]","should omit second index in slice, s\[a:len\(s\)\] is identical to s\[a:\]"
gosimple/usageadvice,警告,"应该使用%s = append(%s, %s...) 来替换循环","should replace loop with \w* = append\(\w*, \w*\.\.\.\)"
gosimple/usageadvice,警告,"应该使用time.Since,而不是time.Now().Sub","should use time\.Since instead of time\.Now\(\)\.Sub"
gosimple/usageadvice,警告,"应该使用time.Util,而不是t.Sub(time.Now())","should use time\.Until instead of t\.Sub\(time\.Now\(\)\)"
gosimple/usageadvice,警告,"应该写 %s 而不是 %s","should write \w* instead of \w*"
gosimple/usageadvice,警告,"_ = <-ch' 可以简化为 '<-ch'","_ = <-ch' can be simplified to '<-ch'"
gosimple/usageadvice,警告,"应该转换 %s(类型为%s)到%s,而不是使用struct结构","should convert \w* (type \w*) to \w* instead of using struct literal"
gosimple/usageadvice,警告,"应该使用无条件的 %s 来替换这个if语句","should replace this if statement with an unconditional \w*"
gosimple/usageadvice,警告,"应该使用无条件的 %s.%s 来替换这个if语句","should replace this if statement with an unconditional \w*\.\w*"
gosimple/usageadvice,警告,"应该使用copy(%s[:%s], %s[%s:])","should use copy\(\w*\[:\w*\], \w*\[\w*:\]\) instead"
gosimple/usageadvice,警告,"应该使用make(%s)","should use make\(\w*, \w*\) instead"
gosimple/usageadvice,警告,"当 %s 为true时,%s不可能为nil","when .* is true, .* can't be nil"
gosimple/usageadvice,警告,"应该在新的一行里合并变量的声明和赋值","should merge variable declaration with assignment on next line"
gosimple/usageadvice,警告,"多余的break语句","redundant break statement"
gosimple/usageadvice,警告,"多余的return语句","redundant return statement"
gosimple/usageadvice,警告,"应该使用String(),而不是fmt.Sprintf","should use String\(\) instead of fmt\.Sprintf"
gosimple/usageadvice,警告,"参数已经是字符串,没有必要使用fmt.Sprintf","the argument is already a string, there's no need to use fmt\.Sprintf"
gosimple/usageadvice,警告,"参数的基础类型是字符串,应该使用简单的转换而不是使用fmt.Sprintf","the argument's underlying type is a string, should use a simple conversion instead of fmt\.Sprintf"
gosimple/usageadvice,警告,"应该使用fmt.Errorf(...),而不是errors.New(fmt.Sprintf(...))","should use fmt\.Errorf\(\.\.\.\) instead of errors\.New\(fmt\.Sprintf\(\.\.\.\)\)"
gosimple/usageadvice,警告,"不必要的nil检查","unnecessary nil check around range"
ineffassign/assign,警告,"无效赋值:%s","ineffectual assignment to \w*"
interfacer/interface,警告,"%s 可以为 %s","\S* can be \S*"
maligned/size,警告,"%s:结构大小%d 可以为 %d",".*: struct of size \d* could be \d*"
misspell/spell,警告,"%s 应拼写为 %s","\S* is a misspelling of \S*"
nakedret/ret,错误,"在%v:%v %v 的第 %v 行的函数,存在空返回值(naked returns)\n","\S* naked returns on \w* line function"
safesql/sql,错误,"潜在不安全的SQL语句","Found \d* potentially unsafe SQL statements:"
staticcheck/append,错误,"append的结果不会被使用,除非在其他的appends里","this result of append is never used, except maybe in other appends"
staticcheck/args,错误,"该函数类似print风格的函数,有第一个动态参数,但没有其他更多的参数。应该使用print风格的函数。","printf-style function with dynamic format string and no further arguments should use print-style function instead"
staticcheck/args,错误,"参数%s在使用前被覆写了","argument \w* is overwritten before first use"
staticcheck/args,错误,"io.Seeker的第一个参数是偏移值offset,但是使用了io.Seek*常量","the first argument of io\.Seeker is the offset, but an io\.Seek\* constant is being used instead"
staticcheck/assign,错误,"不应该赋值给%s","should not assign to \w*"
staticcheck/assign,错误,"赋值给nil map","assignment to nil map"
staticcheck/assign,错误,"%s 自赋值为 %s","self-assignment of \w* to \w*"
staticcheck/boolean,错误,"对于boolean类型的双重否定是没有效果的,是笔误吗?","negating a boolean twice has no effect; is this a typo\?"
staticcheck/break,错误,"break语句没有效果,是希望跳出外部循环吗?","ineffective break statement\. Did you mean to break out of the outer loop\?"
staticcheck/compare,错误,"比较两个不同长度的字符串是否相等,会永远返回false","comparing strings of different sizes for equality will always return false"
staticcheck/compare,错误,"%s类型的每个值都是> = 0","every value of type \w* is >= 0"
staticcheck/compare,错误,"%s类型的值不小于0","no value of type \w* is less than 0"
staticcheck/compare,错误,"没有数值等于NaN,即使Nan本身","no value is equal to NaN, not even NaN itself"
staticcheck/compare,错误,"x & 0的结果永远等于 0","x & 0 always equals 0"
staticcheck/compare,错误,"x %s 0的结果永远等于x","x \S* 0 always equals x"
staticcheck/condition,错误,"这个条件多次出现在if/else if链中","this condition occurs multiple times in this if/else if chain"
staticcheck/defer,错误,"defer %s 前,应该先检查返回的错误码","should check returned error before deferring \S*"
staticcheck/defer,错误,"刚好在lock之后defer %s,你是想defer %s吗?","deferring \S* right after having locked already; did you mean to defer \S*\?"
staticcheck/deprecated,错误,"%s 已经废弃:%s","\S* is deprecated: \S*"
staticcheck/efficient,错误,"m[string(key)] 可能比 k := string(key); m[k] 更加高效","m\[string\(key\)\] would be more efficient than k :\= string\(key\); m\[k\]"
staticcheck/emptybranch,错误,"空的分支","empty branch"
staticcheck/exec,错误,"exec.Command的第一个参数看起来是shell命令,但是缺少了程序名或者路径","first argument to exec.Command looks like a shell command, but a program name or path are expected"
staticcheck/exit,错误,"TestMain应该调用os.Exit来设置退出码","TestMain should call os\.Exit to set exit code"
staticcheck/exp,错误,"%s操作符两边存在相同的表达式","identical expressions on the left and right side of the '\S*' operator"
staticcheck/exp,错误,"二元表达式永远是 %t,对于所有可能的值(%s %s %s)","binary expression is always \S* for all possible values \(\w* \w* \w*\)"
staticcheck/explicit,错误,"只有第1个常量是显式类型","only the first constant in this group has an explicit type"
staticcheck/finalizer,错误,"the finalizer closes over the object, preventing the finalizer from ever running (at %s)","the finalizer closes over the object, preventing the finalizer from ever running \(at .*\)"
staticcheck/goroutine,错误,"goroutine调用T.%s,作为测试test必须在相同的goroutine里调用","the goroutine calls T\.\S*, which must be called in the same goroutine as the test"
staticcheck/httpheader,错误,"在http.Header里的keys都是规范化的,然而%q并不符合规范;修改该常量或者使用http.CanonicalHeaderKey","keys in http.Header are canonicalized, \S* is not canonical; fix the constant or use http.CanonicalHeaderKey"
staticcheck/infinite,错误,"调用了无限递归","infinite recursive call"
staticcheck/iowriter,错误,"io.Writer.Write 不能修改所提供的buffer缓冲区,即使是临时性的","io\.Writer\.Write must not modify the provided buffer, not even temporarily"
staticcheck/loop,错误,"这个循环会spin,导致100%CPU的使用","this loop will spin, using 100%% CPU"
staticcheck/loop,错误,"循环条件一直没有变化,或者存在竞争条件","loop condition never changes or has a race condition"
staticcheck/loop,错误,"无限循环中的defers永远不会运行","defers in this infinite loop will never run"
staticcheck/loop,错误,"在range循环中,defers不会运行,除非通道被关闭","defers in this range loop won't run unless the channel gets closed"
staticcheck/loop,错误,"在for+select循环中不应该存在空的default case,会导致循环spin","should not have an empty default case in a for+select loop. The loop will spin\."
staticcheck/loop,错误,"循环变量没有变化","variable in loop condition never changes"
staticcheck/loop,错误,"外层循环无条件终止","the surrounding loop is unconditionally terminated"
staticcheck/overrun,错误,"index索引超出界限(bounds)","index out of bounds"
staticcheck/resource,错误,"空的临界区(critical section)","empty critical section"
staticcheck/return,错误,"%s 是一个纯函数(pure function),但是它的返回值被忽略了","\S* is a pure function but its return value is ignored"
staticcheck/routine,错误,"启动goroutine前应该先调用%s,以避免竞争","should call \S* before starting the goroutine to avoid a race"
staticcheck/signal,错误,"%s 不能被捕获(是syscall.SIGTERM吗?)","\S* cannot be trapped \(did you mean syscall\.SIGTERM\?\)"
staticcheck/signal,错误,"%s 信号不能被捕获","\S* signal cannot be trapped"
staticcheck/simple,错误,"&*x 可以简化为 x。这个用法不会复制x。","&\*x will be simplified to x\. It will not copy x\."
staticcheck/simple,错误,"*&x 可以简化为 x。这个用法不会复制x。","\*&x will be simplified to x\. It will not copy x\."
staticcheck/simple,错误,"文件模式 %s 计算结果是 %#o;是否应该是 0%s","file mode '\S*' evaluates to \S*; did you mean '0\S*'\?"
staticcheck/sleep,错误,"睡眠 %d(ns)很可能是一个bug。如果不是的话请明确下:%s","sleeping for \d* nanoseconds is probably a bug\. Be explicit if it isn't: \S*"
staticcheck/timeticker,错误,"使用time.Tick在某些场景下会泄漏。可以考虑在endless function中使用,或者使用time.NewTicker。","using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time\.NewTicker here"
staticcheck/unused,错误,"这个变量%s的值不会被使用","this value of \w* is never used"
structcheck/field,警告,"未使用的struct字段","unknown field or method"
unparam/unused,警告,"参数%s没有使用","result \w* is never used"
unparam/value,警告,"参数%s始终是%s","result \w* is always \w*"
unparam/value,警告,"参数始终接收%v","always receives \S*"
unused/unused,警告,"%s没有被使用",".* is unused"
varcheck/unused,警告,"未使用的变量或常量","unused variable or constant invalid operation"
vetshadow/shadow,错误,"%q的声明覆盖了%s位置的声明","declaration of \S* shadows declaration at \S*"