ruff/crates/ruff_linter
Brent Westbrook 98320690dd convert to structs
Move SARIF rendering to ruff_db

Summary
--

This is another mostly-straightforward JSON-based output format. In the first
commit, I converted to using actual structs. I made a couple of tweaks to the
format:

- The `text` field of `SarifRule::full_description` was implicitly an `Option`
before, but serializing this as `null` is invalid based on the [validator]. I
made this an `Option<MessageString>` (`MessageString` is a shortened form of
`multiformatMessageString`, which is what the schema calls this type) and skip
serializing it if it's `None`, which validates against the schema.
- `SarifResult::code` was explicitly an `Option<&'a SecondaryCode>`, which was
also invalid according to the schema. I made it a required field and fell back
on the lint name as in some of the other recent formats. This currently only
affects syntax errors in Ruff.

In the second commit I moved the code to `ruff_db` and updated the Ruff-specific
`expect` calls.

Test Plan
--

Existing tests ported to `ruff_db`

[validator]: https://www.jsonschemavalidator.net/s/GlhhhHQ7
2025-07-15 22:00:19 -04:00
..
resources [`pycodestyle`] Handle brace escapes for t-strings in logical lines (#19358) 2025-07-15 14:48:48 +00:00
src convert to structs 2025-07-15 22:00:19 -04:00
Cargo.toml Bump 0.12.3 (#19279) 2025-07-11 09:07:50 -04:00