-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute tool in sarif mode before report checking (#498)
### What's done: * Execute tool before checking the sarif report, this logic allows: 1) Support checking `.sarif` from stdout 2) Rewrite existing sarif report, if `actual[Warnings|Fix]SarifFileName` was provided and something were changed in report * Minor refactoring * Add possible config for one of the test (however it's not required, since `save-cli` will look into stdout by default)
- Loading branch information
1 parent
daf00e5
commit c520f6b
Showing
5 changed files
with
229 additions
and
50 deletions.
There are no files selected for viewing
155 changes: 155 additions & 0 deletions
155
examples/kotlin-diktat/sarif-actual/save-warnings-actual.sarif
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,155 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", | ||
"version": "2.1.0", | ||
"runs": [ | ||
{ | ||
"originalUriBaseIds": { | ||
"%SRCROOT%": { | ||
"uri": "file://D:/projects/" | ||
} | ||
}, | ||
"results": [ | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 35, | ||
"startLine": 6 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[WRONG_DECLARATIONS_ORDER] declarations of constants and enum members should be sorted alphabetically: enum entries order is incorrect (diktat-ruleset:abp-sort-rule)" | ||
}, | ||
"ruleId": "diktat-ruleset:abp-sort-rule" | ||
}, | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 5, | ||
"startLine": 10 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[ENUMS_SEPARATED] enum is incorrectly formatted: enums must end with semicolon (diktat-ruleset:abq-enum-separated)" | ||
}, | ||
"ruleId": "diktat-ruleset:abq-enum-separated" | ||
}, | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 5, | ||
"startLine": 8 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[ENUM_VALUE] enum values should be in selected UPPER_CASE snake/PascalCase format: paSC_SAl_l (diktat-ruleset:aai-identifier-naming)" | ||
}, | ||
"ruleId": "diktat-ruleset:aai-identifier-naming" | ||
}, | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 5, | ||
"startLine": 11 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[ENUM_VALUE] enum values should be in selected UPPER_CASE snake/PascalCase format: PascAsl_f (diktat-ruleset:aai-identifier-naming)" | ||
}, | ||
"ruleId": "diktat-ruleset:aai-identifier-naming" | ||
}, | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 5, | ||
"startLine": 10 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[ENUMS_SEPARATED] enum is incorrectly formatted: last enum entry must end with a comma (diktat-ruleset:abq-enum-separated)" | ||
}, | ||
"ruleId": "diktat-ruleset:abq-enum-separated" | ||
}, | ||
{ | ||
"level": "error", | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "src\\kotlin\\EnumValueSnakeCaseTest.kt", | ||
"uriBaseId": "%SRCROOT%" | ||
}, | ||
"region": { | ||
"startColumn": 9, | ||
"startLine": 1 | ||
} | ||
} | ||
} | ||
], | ||
"message": { | ||
"text": "[PACKAGE_NAME_INCORRECT_PREFIX] package name should start from company's domain: com.saveourtool.save (diktat-ruleset:aah-package-naming)" | ||
}, | ||
"ruleId": "diktat-ruleset:aah-package-naming" | ||
} | ||
], | ||
"tool": { | ||
"driver": { | ||
"downloadUri": "https://github.com/pinterest/ktlint/releases/tag/0.42.0", | ||
"fullName": "ktlint", | ||
"informationUri": "https://github.com/pinterest/ktlint/", | ||
"language": "en", | ||
"name": "ktlint", | ||
"organization": "pinterest", | ||
"rules": [ | ||
], | ||
"semanticVersion": "0.42.0", | ||
"version": "0.42.0" | ||
} | ||
} | ||
} | ||
] | ||
} |
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