-
-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate sonar types in a dedicated package (#604)
- Loading branch information
Showing
4 changed files
with
124 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package sonar | ||
|
||
//TextRange defines the text range of an issue's location | ||
type TextRange struct { | ||
StartLine int `json:"startLine"` | ||
EndLine int `json:"endLine"` | ||
StartColumn int `json:"startColumn,omitempty"` | ||
EtartColumn int `json:"endColumn,omitempty"` | ||
} | ||
|
||
//Location defines a sonar issue's location | ||
type Location struct { | ||
Message string `json:"message"` | ||
FilePath string `json:"filePath"` | ||
TextRange *TextRange `json:"textRange,omitempty"` | ||
} | ||
|
||
//Issue defines a sonar issue | ||
type Issue struct { | ||
EngineID string `json:"engineId"` | ||
RuleID string `json:"ruleId"` | ||
PrimaryLocation *Location `json:"primaryLocation"` | ||
Type string `json:"type"` | ||
Severity string `json:"severity"` | ||
EffortMinutes int `json:"effortMinutes"` | ||
SecondaryLocations []*Location `json:"secondaryLocations,omitempty"` | ||
} | ||
|
||
//Report defines a sonar report | ||
type Report struct { | ||
Issues []*Issue `json:"issues"` | ||
} |