-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use enum instead of string as issue severity
- Loading branch information
Showing
6 changed files
with
28 additions
and
12 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
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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
package tflint | ||
|
||
// List of issue severity levels. The rules implemented by a plugin can be set to any severity. | ||
// Severity indicates the severity of the issue. | ||
type Severity int32 | ||
|
||
const ( | ||
// ERROR is possible errors | ||
ERROR = "Error" | ||
ERROR Severity = iota | ||
// WARNING doesn't cause problem immediately, but not good | ||
WARNING = "Warning" | ||
WARNING | ||
// NOTICE is not important, it's mentioned | ||
NOTICE = "Notice" | ||
NOTICE | ||
) | ||
|
||
// String returns the string representation of the severity. | ||
func (s Severity) String() string { | ||
switch s { | ||
case ERROR: | ||
return "Error" | ||
case WARNING: | ||
return "Warning" | ||
case NOTICE: | ||
return "Notice" | ||
} | ||
|
||
return "Unknown" | ||
} |
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