-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to ignore faillint problems (#11)
* Add ability to ignore faillint problems Linter directive is based on staticcheck. * Remove reference to staticcheck now that it's more loosely based on staticchecks' linter directives * Clarify file-ignore placement * Refactor ignore/fileignore constants - Rename - Move - Comment * Report missing reasons * Report out of place file-ignore option * Add test coverage for hasDirective * Add valid case coverage to TestHasDirective unit test * Add test case for variation of package comment * Loosen restrictions on the placement of the file-ignore directive * Remove code which can no longer execute * Switch to staticcheck style directives
- Loading branch information
Showing
10 changed files
with
351 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
|
||
faillint/testdata/pkg | ||
|
||
# IDE workspace files | ||
/.vscode/ |
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
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,11 @@ | ||
package j | ||
|
||
import ( | ||
//lint:ignore faillint tolerate this errors import | ||
"errors" | ||
"fmt" //lint:ignore faillint tolerate this fmt import | ||
) | ||
|
||
func foo() error { | ||
return errors.New(fmt.Sprintf("%s!", "bar")) | ||
} |
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,10 @@ | ||
//lint:file-ignore faillint ignore faillint in this file | ||
package k | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
func foo() error { | ||
return errors.New("bar!") | ||
} |
Oops, something went wrong.