Skip to content
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

Use ast::PythonVersion internally in the formatter and linter #16170

Merged
merged 36 commits into from
Feb 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
48e7160
add serde adapter module, use PythonVersion in formatter
ntBre Feb 14, 2025
ad7f688
convert to old PythonVersion for formatter snapshots
ntBre Feb 14, 2025
55d4b5e
accept ruff settings snapshot (bad idea?)
ntBre Feb 14, 2025
84f518a
tidy formatter PythonVersion
ntBre Feb 14, 2025
f40253c
use (de)serialize_with in linter too
ntBre Feb 14, 2025
50fd040
delete separate enum code
ntBre Feb 14, 2025
a38c577
use Display instead of Debug for showing settings
ntBre Feb 17, 2025
195dd99
only use AstPythonVersion internally, move pep440 to external side
ntBre Feb 17, 2025
e218330
move adapter functions to `serde` module and rename
ntBre Feb 17, 2025
7ef41dc
update schema
ntBre Feb 17, 2025
67b2ffc
gate CacheKey behind existing `cache` feature
ntBre Feb 17, 2025
da98908
move serde helpers to formatter, where they are used
ntBre Feb 17, 2025
e12fe0a
remove serde adapters
ntBre Feb 17, 2025
8349aab
print the filename for failed format tests
ntBre Feb 17, 2025
a0c5cd6
update formatter json files for new serialization format
ntBre Feb 17, 2025
ee268a4
use PythonVersion Display impl instead of converting, update snaps
ntBre Feb 17, 2025
af041b6
remove unused TryFrom
ntBre Feb 17, 2025
4ede555
remove `latest` comment, the method no longer exists
ntBre Feb 17, 2025
33caff6
simplify From now that as_tuple is back
ntBre Feb 17, 2025
e9be081
remove unused Default impl for formatter::PythonVersion
ntBre Feb 17, 2025
02297d4
update comment
ntBre Feb 17, 2025
55e76fa
restore try_from and use it for default
ntBre Feb 18, 2025
0de7783
test that PythonVersion::default doesn't panic
ntBre Feb 18, 2025
d64deb0
pub use python_version and use ast::PythonVersion
ntBre Feb 18, 2025
020ffdf
serde mod doesn't need pub now
ntBre Feb 18, 2025
5f7ee7a
remove PartialOrd and Ord
ntBre Feb 18, 2025
bad3bb7
remove CacheKey
ntBre Feb 18, 2025
3231dde
move `get_minimum_supported_version` to where it's used
ntBre Feb 18, 2025
0abcc2c
update import script
ntBre Feb 18, 2025
6dc5bf9
delete formatter PythonVersion
ntBre Feb 18, 2025
3c90da8
fix imports
ntBre Feb 18, 2025
b75d033
use PythonVersion from ruff_python_ast, not ast::python_version
ntBre Feb 18, 2025
5acc2ae
Merge branch 'main' into brent/formatter-version
ntBre Feb 18, 2025
8d7cc7a
tidy up after merge
ntBre Feb 18, 2025
f8f162f
fix panic message on invalid JSON file
ntBre Feb 18, 2025
4e98d1a
document unwrap safety
ntBre Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ruff_linter/src/settings/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::{display_settings, fs};
pub enum PythonVersion {
Py37,
Py38,
// Make sure to also change the default for `ruff_python_formatter::PythonVersion`
// Make sure to also change the default for `ruff_python_ast::PythonVersion`
// when changing the default here.
#[default]
Py39,
Expand Down
Loading