-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 'package-comments' false positive for CRLF sources
- Loading branch information
1 parent
9177f50
commit 8a00ee6
Showing
6 changed files
with
46 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# These Go files must have CRLF endings | ||
testdata/package_comments_issue607*.go text eol=crlf |
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
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,16 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/mgechev/revive/lint" | ||
"github.com/mgechev/revive/rule" | ||
) | ||
|
||
func TestPackageCommentsIssue607NotMatch(t *testing.T) { | ||
testRule(t, "package_comments_issue607_not_match", &rule.PackageCommentsRule{}, &lint.RuleConfig{}) | ||
} | ||
|
||
func TestPackageCommentsIssue607Match(t *testing.T) { | ||
testRule(t, "package_comments_issue607_match", &rule.PackageCommentsRule{}, &lint.RuleConfig{}) | ||
} |
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,8 @@ | ||
/* | ||
Package fixtures has a multi-line comment. | ||
Its line endings have a carriage return. | ||
*/ | ||
|
||
package fixtures | ||
|
||
// MATCH:4 /package comment is detached; there should be no blank lines between it and the package statement/ |
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,5 @@ | ||
/* | ||
Package fixtures has a multi-line comment. | ||
Its line endings have a carriage return. | ||
*/ | ||
package fixtures |