-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The sarif output should somehow let users know about the linter #13
Comments
@jmacku fyi |
Nah, I meant @jamacku, sorry. |
This has to be dealt with in # The sed part ensures that cstools will recognize the output as being produced by ShellCheck and not GCC.
local output
output=$(shellcheck "${shellcheck_args[@]}" 2> /dev/null | sed -e 's|$| <--[shellcheck]|') But this wouldn't be the complete solution. Ideally, we should generate SARIF so that each tool has its own section. /cc @lzaoral For reference, SARIF with defects detected by {
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
"version": "2.1.0",
"inlineExternalProperties": [
{
"externalizedProperties": {
"tool": "vcs-diff-lint",
"tool-url": "https://github.com/fedora-copr/vcs-diff-lint#readme"
}
}
],
"runs": [
{
"tool": {
"driver": {
"name": "vcs-diff-lint",
"informationUri": "https://github.com/fedora-copr/vcs-diff-lint#readme"
}
},
"results": [
{
"ruleId": "PYLINT_WARNING: W0402[deprecated-module]",
"locations": [
{
"id": 0,
"physicalLocation": {
"artifactLocation": {
"uri": "mock/py/mock.py"
},
"region": {
"startLine": 60
}
}
}
],
"message": {
"text": "Deprecated module 'pipes'"
},
"codeFlows": [
{
"threadFlows": [
{
"locations": [
{
"location": {
"id": 0,
"physicalLocation": {
"artifactLocation": {
"uri": "mock/py/mock.py"
},
"region": {
"startLine": 60
}
},
"message": {
"text": "Deprecated module 'pipes'"
}
},
"nestingLevel": 0,
"kinds": [
"W0402[deprecated-module]"
]
}
]
}
]
}
]
},
{
"ruleId": "PYLINT_WARNING: W0611[unused-import]",
"locations": [
{
"id": 0,
"physicalLocation": {
"artifactLocation": {
"uri": "mock/py/mock.py"
},
"region": {
"startLine": 60
}
}
}
],
"message": {
"text": "Unused import pipes"
},
"codeFlows": [
{
"threadFlows": [
{
"locations": [
{
"location": {
"id": 0,
"physicalLocation": {
"artifactLocation": {
"uri": "mock/py/mock.py"
},
"region": {
"startLine": 60
}
},
"message": {
"text": "Unused import pipes"
}
},
"nestingLevel": 0,
"kinds": [
"W0611[unused-import]"
]
}
]
}
]
}
]
}
]
}
]
} |
Aha, thank you! So there are no other useful metadata fields |
The There is opened PR on |
Experimenting with the SARIF upload, it seems that it is not obvious what tool generates the error message:
![Screenshot_20230131_093911](https://user-images.githubusercontent.com/3277839/215710318-bec59478-4dd4-47ac-adb4-4092ea1f4232.png)
The output from vcs-diff-lint now supports at least MYPY_ERROR, MYPY_WARNING, PYLINT_WARNING types.
The text was updated successfully, but these errors were encountered: