-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the documentation for comment annotations
Fix #1
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package fixtures | ||
|
||
//revive:disable | ||
func Public1() { | ||
} | ||
|
||
//revive:enable | ||
|
||
func Public2() { // MATCH /exported function Public2 should have comment or be unexported/ | ||
} | ||
|
||
//revive:disable:exported | ||
func Public3() { | ||
} | ||
|
||
//revive:enable:exported | ||
|
||
//revive:disable:random | ||
|
||
func Public4() { // MATCH /exported function Public4 should have comment or be unexported/ | ||
} | ||
|
||
//revive:enable:random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/mgechev/revive/lint" | ||
"github.com/mgechev/revive/rule" | ||
) | ||
|
||
func TestDisabledAnnotations(t *testing.T) { | ||
testRule(t, "disable-annotations", &rule.ExportedRule{}, &lint.RuleConfig{}) | ||
} |