Skip to content

Commit

Permalink
Discard changes to crates/ruff_python_formatter/src/lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jan 16, 2025
1 parent d9c9aab commit 701e96d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/ruff_python_formatter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,22 @@ if True:
#[test]
fn quick_test() {
let source = r#"
string = "this is my string with " f'"{params.get("mine")}"'
def main() -> None:
if True:
some_very_long_variable_name_abcdefghijk = Foo()
some_very_long_variable_name_abcdefghijk = some_very_long_variable_name_abcdefghijk[
some_very_long_variable_name_abcdefghijk.some_very_long_attribute_name
== "This is a very long string abcdefghijk"
]
"#;
let source_type = PySourceType::Python;

// Parse the AST.
let source_path = "code_inline.py";
let parsed = parse(source, source_type.as_mode()).unwrap();
let comment_ranges = CommentRanges::from(parsed.tokens());
let options = PyFormatOptions::from_extension(Path::new(source_path))
.with_quote_style(crate::QuoteStyle::Preserve);
let options = PyFormatOptions::from_extension(Path::new(source_path));
let formatted = format_module_ast(&parsed, &comment_ranges, source, options).unwrap();

// Uncomment the `dbg` to print the IR.
Expand Down

0 comments on commit 701e96d

Please sign in to comment.