mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 07:04:28 -05:00
Implement template strings (#17851)
This PR implements template strings (t-strings) in the parser and formatter for Ruff. Minimal changes necessary to compile were made in other parts of the code (e.g. ty, the linter, etc.). These will be covered properly in follow-up PRs.
This commit is contained in:
@@ -40,7 +40,7 @@ fn inline_err() {
|
||||
fn test_valid_syntax(input_path: &Path) {
|
||||
let source = fs::read_to_string(input_path).expect("Expected test file to exist");
|
||||
let options = extract_options(&source).unwrap_or_else(|| {
|
||||
ParseOptions::from(Mode::Module).with_target_version(PythonVersion::latest())
|
||||
ParseOptions::from(Mode::Module).with_target_version(PythonVersion::latest_preview())
|
||||
});
|
||||
let parsed = parse_unchecked(&source, options.clone());
|
||||
|
||||
@@ -133,7 +133,7 @@ fn test_valid_syntax(input_path: &Path) {
|
||||
fn test_invalid_syntax(input_path: &Path) {
|
||||
let source = fs::read_to_string(input_path).expect("Expected test file to exist");
|
||||
let options = extract_options(&source).unwrap_or_else(|| {
|
||||
ParseOptions::from(Mode::Module).with_target_version(PythonVersion::latest())
|
||||
ParseOptions::from(Mode::Module).with_target_version(PythonVersion::PY314)
|
||||
});
|
||||
let parsed = parse_unchecked(&source, options.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user