ruff/crates/ruff_python_ast/src
Brent Westbrook a9efdea113
Use ast::PythonVersion internally in the formatter and linter (#16170)
## Summary

This PR updates the formatter and linter to use the `PythonVersion`
struct from the `ruff_python_ast` crate internally. While this doesn't
remove the need for the `linter::PythonVersion` enum, it does remove the
`formatter::PythonVersion` enum and limits the use in the linter to
deserializing from CLI arguments and config files and moves most of the
remaining methods to the `ast::PythonVersion` struct.

## Test Plan

Existing tests, with some inputs and outputs updated to reflect the new
(de)serialization format. I think these are test-specific and shouldn't
affect any external (de)serialization.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-02-18 12:03:13 -05:00
..
visitor Auto-generate AST boilerplate (#15544) 2025-01-17 14:23:02 -05:00
comparable.rs Respect hash-equivalent literals in iteration-over-set (#14063) 2024-11-03 18:44:52 +00:00
docstrings.rs
expression.rs Remove customizable reference enum names (#15647) 2025-01-21 13:46:31 -05:00
generated.rs Replace is-macro with implementation in enums (#16144) 2025-02-13 22:49:00 +00:00
helpers.rs [flake8-annotations] Correct syntax for typing.Union in suggested return type fixes for ANN20x rules (#16025) 2025-02-07 17:17:20 -06:00
identifier.rs Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
int.rs [ruff] Unnecessary cast to int (RUF046) (#14697) 2024-12-05 10:30:06 +01:00
lib.rs Use ast::PythonVersion internally in the formatter and linter (#16170) 2025-02-18 12:03:13 -05:00
name.rs Transition to salsa coarse-grained tracked structs (#15763) 2025-02-11 11:38:50 +01:00
node.rs Remove AstNode and AnyNode (#15479) 2025-01-17 17:11:00 -05:00
nodes.rs Improve API exposed on ExprStringLiteral nodes (#16192) 2025-02-17 07:58:54 +00:00
operator_precedence.rs [internal] Move Linter OperatorPrecedence into ruff_python_ast crate (#16162) 2025-02-14 15:55:07 +01:00
parenthesize.rs Remove customizable reference enum names (#15647) 2025-01-21 13:46:31 -05:00
python_version.rs Use ast::PythonVersion internally in the formatter and linter (#16170) 2025-02-18 12:03:13 -05:00
relocate.rs Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
script.rs Skip namespace package enforcement for PEP 723 scripts (#13974) 2024-10-29 02:11:31 +00:00
statement_visitor.rs Remove Stmt::TryStar (#6566) 2023-08-14 13:39:44 -04:00
stmt_if.rs Misc. small tweaks from perusing modules (#9383) 2024-01-03 12:30:25 -05:00
str.rs Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
str_prefix.rs Reduce memory usage of Docstring struct (#16183) 2025-02-16 15:23:52 +00:00
traversal.rs Use referencial equality in traversal helper methods (#13895) 2024-10-24 11:30:22 +02:00
types.rs Remove RefEquality (#6393) 2023-08-07 16:04:50 +00:00
visitor.rs Simplify iteration idioms (#13834) 2024-10-20 22:25:27 +01:00
whitespace.rs Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00