ruff/crates
Brent Westbrook 2643dc5b7a
Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179)
## Summary

This PR addresses some additional feedback on #19053:

- Renaming the `syntax_error` methods to `invalid_syntax` to match the
lint id
- Moving the standalone `diagnostic_from_violation` function to
`Violation::into_diagnostic`
- Removing the `Ord` and `PartialOrd` implementations from `Diagnostic`
in favor of `Diagnostic::start_ordering`

## Test Plan

Existing tests

## Additional Follow-ups

Besides these, I also put the following comments on my todo list, but
they seemed like they might be big enough to have their own PRs:

- [Use `LintId::IOError` for IO
errors](https://github.com/astral-sh/ruff/pull/19053#discussion_r2189425922)
- [Move `Fix` and
`Edit`](https://github.com/astral-sh/ruff/pull/19053#discussion_r2189448647)
- [Avoid so many
unwraps](https://github.com/astral-sh/ruff/pull/19053#discussion_r2189465980)
2025-07-08 09:54:19 -04:00
..
ruff Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ruff_annotate_snippets
ruff_benchmark [ty] Re-enable multithreaded pydantic benchmark (#19176) 2025-07-07 14:28:15 +02:00
ruff_cache
ruff_db Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ruff_dev Avoid reformatting comments in rules reference documentation (#19093) 2025-07-02 17:16:44 +02:00
ruff_diagnostics Combine OldDiagnostic and Diagnostic (#19053) 2025-07-03 13:01:09 -04:00
ruff_formatter
ruff_graph
ruff_index
ruff_linter Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ruff_macros
ruff_notebook
ruff_options_metadata
ruff_python_ast Make dependency get-size2 truly optional in ruff_python_ast (#19052) 2025-06-30 21:50:59 -05:00
ruff_python_ast_integration_tests
ruff_python_codegen
ruff_python_formatter Update pre-commit dependencies (#19162) 2025-07-07 04:07:44 +00:00
ruff_python_index
ruff_python_literal
ruff_python_parser Combine OldDiagnostic and Diagnostic (#19053) 2025-07-03 13:01:09 -04:00
ruff_python_semantic
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests
ruff_server Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ruff_source_file
ruff_text_size
ruff_wasm Combine OldDiagnostic and Diagnostic (#19053) 2025-07-03 13:01:09 -04:00
ruff_workspace Fix description of the format.skip-magic-trailing-comma example (#19095) 2025-07-03 10:39:59 -04:00
ty [ty] Add an empty line to separate bullet points (#19195) 2025-07-08 05:10:31 +00:00
ty_ide [ty] First cut at semantic token provider (#19108) 2025-07-07 15:34:47 -07:00
ty_project Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ty_python_semantic Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ty_server [ty] First cut at semantic token provider (#19108) 2025-07-07 15:34:47 -07:00
ty_test Rename Diagnostic::syntax_error methods, separate Ord implementation (#19179) 2025-07-08 09:54:19 -04:00
ty_vendored [ty] Sync vendored typeshed stubs (#19174) 2025-07-07 12:00:09 +02:00
ty_wasm [ty] Support LSP go-to with vendored typeshed stubs (#19057) 2025-07-02 07:58:58 -04:00