Skip to content

Enrich messages of SARIF results#13180

Merged
MichaReiser merged 3 commits intoastral-sh:mainfrom
RussellLuo:enrich-sarif-message
Sep 1, 2024
Merged

Enrich messages of SARIF results#13180
MichaReiser merged 3 commits intoastral-sh:mainfrom
RussellLuo:enrich-sarif-message

Conversation

@RussellLuo
Copy link
Copy Markdown
Contributor

Closes #13179.

After this patch, we'll get more informative messages as below:

{
  "$schema": "https://json.schemastore.org/sarif-2.1.0.json",
  "runs": [
    {
      "results": [
        {
          "level": "error",
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {...},
                "region": {
                  "endColumn": 10,
                  "endLine": 1,
                  "startColumn": 8,
                  "startLine": 1
                }
              }
            }
          ],
          "message": {
            "text": "`os` imported but unused"
          },
          "ruleId": "F401"
        },
        {
          "level": "error",
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {...},
                "region": {
                  "endColumn": 34,
                  "endLine": 4,
                  "startColumn": 11,
                  "startLine": 4
                }
              }
            }
          ],
          "message": {
            "text": "`.format` call is missing argument(s) for placeholder(s): name"
          },
          "ruleId": "F524"
        }
      ],
      "tool": {...}
    }
  ],
  "version": "2.1.0"
}

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 31, 2024

CodSpeed Performance Report

Merging #13180 will not alter performance

Comparing RussellLuo:enrich-sarif-message (8c25f9c) with main (3ceedf7)

Summary

✅ 32 untouched benchmarks

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 31, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Copy Markdown
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@MichaReiser MichaReiser added the cli Related to the command-line interface label Sep 1, 2024
@MichaReiser MichaReiser merged commit dd5d0d5 into astral-sh:main Sep 1, 2024
@RussellLuo RussellLuo deleted the enrich-sarif-message branch September 1, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enrich messages of SARIF results

2 participants