-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Support ruff's sarif output and .ruff.toml config #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
Conversation
Code Review Agent Run Status
|
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR adds support for ruff's SARIF output and introduces a new configuration file format (.ruff.toml) for improved compatibility.
- Introduces a new script (ruff_sarif_to_trunk_sarif.py) to convert ruff’s SARIF output
- Updates the plugin configuration to reference the new SARIF parser and adds ".ruff.toml" as a direct configuration file
Reviewed Changes
| File | Description |
|---|---|
| linters/ruff/ruff_sarif_to_trunk_sarif.py | Adds a script to post-process ruff’s SARIF output by standardizing ruleIds |
| linters/ruff/plugin.yaml | Updates the linter configuration to use the new parser and include .ruff.toml |
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
linters/ruff/ruff_sarif_to_trunk_sarif.py:10
- [nitpick] Consider defining a constant for the fallback ruleId (e.g., E999) instead of using the magic literal directly.
if result["ruleId"] is None:
linters/ruff/plugin.yaml:67
- Ensure that the updated reference to ruff_sarif_to_trunk_sarif.py is consistent throughout the plugin configuration and that outdated references have been removed.
run: python3 ${cwd}/ruff_sarif_to_trunk_sarif.py
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
PR Type
Enhancement, Tests
Description
Added support for Ruff's SARIF output format.
Introduced a custom parser to handle
ruleIdnull cases.Updated
plugin.yamlto include.ruff.tomlconfiguration support.Added comprehensive test snapshots for Ruff linter functionality.
Changes walkthrough 📝
ruff_sarif_to_trunk_sarif.py
Add custom parser for Ruff SARIF outputlinters/ruff/ruff_sarif_to_trunk_sarif.py
ruleIdis null by assigning "E999".plugin.yaml
Update plugin configuration for Ruff SARIF and `.ruff.toml`linters/ruff/plugin.yaml
.ruff.tomlas a direct configuration file.ruff_v0.9.9_basic.check.shot
Add test snapshot for basic Ruff lintinglinters/ruff/test_data/ruff_v0.9.9_basic.check.shot
ruff_v0.9.9_basic_nb.check.shot
Add test snapshot for Ruff on Jupyter notebookslinters/ruff/test_data/ruff_v0.9.9_basic_nb.check.shot
ruff_v0.9.9_interface.check.shot
Add test snapshot for Ruff on Python interfaceslinters/ruff/test_data/ruff_v0.9.9_interface.check.shot
ruff_v0.9.9_syntax.check.shot
Add test snapshot for Ruff syntax error handlinglinters/ruff/test_data/ruff_v0.9.9_syntax.check.shot
E999code.This change is