mirror of
https://github.com/mgechev/revive.git
synced 2025-01-06 03:04:06 +02:00
parent
1acbe6b30e
commit
89f108c22a
@ -207,7 +207,7 @@ func (f *File) disabledIntervals(rules []Rule, mustSpecifyDisableReason bool, fa
|
||||
for _, c := range comments {
|
||||
match := re.FindStringSubmatch(c.Text)
|
||||
if len(match) == 0 {
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
ruleNames := []string{}
|
||||
|
@ -14,3 +14,7 @@ func TestDisabledAnnotations(t *testing.T) {
|
||||
func TestModifiedAnnotations(t *testing.T) {
|
||||
testRule(t, "disable-annotations2", &rule.VarNamingRule{}, &lint.RuleConfig{})
|
||||
}
|
||||
|
||||
func TestDisableNextLineAnnotations(t *testing.T) {
|
||||
testRule(t, "disable-annotations3", &rule.VarNamingRule{}, &lint.RuleConfig{})
|
||||
}
|
14
testdata/disable-annotations3.go
vendored
Normal file
14
testdata/disable-annotations3.go
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// Package fix_tures is a testing package
|
||||
// tests for issue #540
|
||||
//revive:disable-next-line:var-naming
|
||||
package fix_tures
|
||||
|
||||
func foo1() {
|
||||
// something before the annotation
|
||||
//revive:disable-next-line:var-naming
|
||||
// something after
|
||||
var invalid_name = 0
|
||||
}
|
||||
|
||||
//revive:disable-next-line:var-naming
|
||||
func (source Source) BaseApiURL() string {}
|
Loading…
Reference in New Issue
Block a user