mirror of
https://github.com/mgechev/revive.git
synced 2025-09-16 09:06:22 +02:00
@@ -207,7 +207,7 @@ func (f *File) disabledIntervals(rules []Rule, mustSpecifyDisableReason bool, fa
|
|||||||
for _, c := range comments {
|
for _, c := range comments {
|
||||||
match := re.FindStringSubmatch(c.Text)
|
match := re.FindStringSubmatch(c.Text)
|
||||||
if len(match) == 0 {
|
if len(match) == 0 {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
ruleNames := []string{}
|
ruleNames := []string{}
|
||||||
|
@@ -14,3 +14,7 @@ func TestDisabledAnnotations(t *testing.T) {
|
|||||||
func TestModifiedAnnotations(t *testing.T) {
|
func TestModifiedAnnotations(t *testing.T) {
|
||||||
testRule(t, "disable-annotations2", &rule.VarNamingRule{}, &lint.RuleConfig{})
|
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 {}
|
Reference in New Issue
Block a user