diff options
author | Antoine Vinot <antoine.vinot@sonarsource.com> | 2022-11-08 12:14:43 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-11-15 20:02:59 +0000 |
commit | 59df4a4ad498fa1ce6df396c0b7a6afb70b7ec83 (patch) | |
tree | 67292d7f45cac35e36326184db085e115b6e4e14 /sonar-core/src/test/resources | |
parent | 7b6049377bbeb887442a038efbc119656ebb3a12 (diff) | |
download | sonarqube-59df4a4ad498fa1ce6df396c0b7a6afb70b7ec83.tar.gz sonarqube-59df4a4ad498fa1ce6df396c0b7a6afb70b7ec83.zip |
SONAR-17560 Add Sarif deserialization
Diffstat (limited to 'sonar-core/src/test/resources')
-rw-r--r-- | sonar-core/src/test/resources/org/sonar/core/sarif/eslint-sarif210.json | 57 | ||||
-rw-r--r-- | sonar-core/src/test/resources/org/sonar/core/sarif/invalid-json-syntax.json | 8 |
2 files changed, 65 insertions, 0 deletions
diff --git a/sonar-core/src/test/resources/org/sonar/core/sarif/eslint-sarif210.json b/sonar-core/src/test/resources/org/sonar/core/sarif/eslint-sarif210.json new file mode 100644 index 00000000000..3d7d3445738 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/sarif/eslint-sarif210.json @@ -0,0 +1,57 @@ +{ + "version": "2.1.0", + "$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.4", + "runs": [ + { + "tool": { + "driver": { + "name": "ESLint", + "informationUri": "https://eslint.org", + "rules": [ + { + "id": "no-unused-vars", + "shortDescription": { + "text": "disallow unused variables" + }, + "helpUri": "https://eslint.org/docs/rules/no-unused-vars", + "properties": { + "category": "Variables" + } + } + ] + } + }, + "artifacts": [ + { + "location": { + "uri": "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js" + } + } + ], + "results": [ + { + "level": "error", + "message": { + "text": "'x' is assigned a value but never used." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js", + "index": 0 + }, + "region": { + "startLine": 1, + "startColumn": 5 + } + } + } + ], + "ruleId": "no-unused-vars", + "ruleIndex": 0 + } + ] + } + ] +} diff --git a/sonar-core/src/test/resources/org/sonar/core/sarif/invalid-json-syntax.json b/sonar-core/src/test/resources/org/sonar/core/sarif/invalid-json-syntax.json new file mode 100644 index 00000000000..eff20eb286a --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/sarif/invalid-json-syntax.json @@ -0,0 +1,8 @@ +{ + "version": "2.1.0", + "$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.4", + "runs": + { + + } +} |