ruff/crates
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
..
ruff convert to structs 2025-07-15 22:00:19 -04:00
ruff_annotate_snippets Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_benchmark [ty] Enum literal types (#19328) 2025-07-15 21:31:53 +02:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db Move Pylint rendering to `ruff_db` (#19340) 2025-07-15 10:14:49 -04:00
ruff_dev Auto-generate environment variable references for ty (#19205) 2025-07-08 10:48:31 -04:00
ruff_diagnostics Combine `OldDiagnostic` and `Diagnostic` (#19053) 2025-07-03 13:01:09 -04:00
ruff_formatter Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_graph Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_index Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_linter convert to structs 2025-07-15 22:00:19 -04:00
ruff_macros [ty] Merge `ty_macros` into `ruff_macros` (#19229) 2025-07-09 11:28:21 +00:00
ruff_notebook Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_options_metadata [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ruff_python_ast [ty] Use an interval map for scopes by expression (#19025) 2025-07-14 13:50:58 +02:00
ruff_python_ast_integration_tests [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
ruff_python_codegen Fix f-string interpolation escaping (#18882) 2025-06-25 10:04:15 +02:00
ruff_python_formatter Update pre-commit dependencies (#19162) 2025-07-07 04:07:44 +00:00
ruff_python_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser [ty] add support for `nonlocal` statements 2025-07-11 09:44:54 -07:00
ruff_python_semantic [`flake8-return`] Fix false-positive for variables used inside nested functions in `RET504` (#18433) 2025-07-10 16:10:22 -04:00
ruff_python_stdlib Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia Treat `ty: ` comments as pragma comments (#18532) 2025-06-07 16:02:43 +02:00
ruff_python_trivia_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_server Render Azure, JSON, and JSON lines output with the new diagnostics (#19133) 2025-07-11 15:04:46 -04:00
ruff_source_file Move Pylint rendering to `ruff_db` (#19340) 2025-07-15 10:14:49 -04:00
ruff_text_size [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
ruff_wasm Bump 0.12.3 (#19279) 2025-07-11 09:07:50 -04:00
ruff_workspace Fix description of the `format.skip-magic-trailing-comma` example (#19095) 2025-07-03 10:39:59 -04:00
ty lint on the `global` keyword if there's no explicit definition in the global scope 2025-07-15 16:56:54 -07:00
ty_ide [ty] Enum literal types (#19328) 2025-07-15 21:31:53 +02:00
ty_project [ty] Use python version and path from Python extension (#19012) 2025-07-14 09:47:27 +00:00
ty_python_semantic lint on the `global` keyword if there's no explicit definition in the global scope 2025-07-15 16:56:54 -07:00
ty_server [ty] Remove `ConnectionInitializer` (#19353) 2025-07-15 17:02:44 +05:30
ty_static [ty] Merge `ty_macros` into `ruff_macros` (#19229) 2025-07-09 11:28:21 +00:00
ty_test [ty] Make `check_file` a salsa query (#19255) 2025-07-10 18:46:56 +05:30
ty_vendored [ty] Sync vendored typeshed stubs (#19368) 2025-07-15 18:14:46 +00:00
ty_wasm [ty] Fix server version (#19284) 2025-07-14 09:06:34 +02:00