mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Maybe parenthesize long constants and names (#6816)
This commit is contained in:
parent
e4c13846e3
commit
04a9a8dd03
20 changed files with 357 additions and 368 deletions
|
@ -249,12 +249,10 @@ if True:
|
|||
#[test]
|
||||
fn quick_test() {
|
||||
let src = r#"
|
||||
@MyDecorator(list = a) # fmt: skip
|
||||
# trailing comment
|
||||
class Test:
|
||||
pass
|
||||
|
||||
|
||||
for converter in connection.ops.get_db_converters(
|
||||
expression
|
||||
) + expression.get_db_converters(connection):
|
||||
...
|
||||
"#;
|
||||
// Tokenize once
|
||||
let mut tokens = Vec::new();
|
||||
|
@ -291,9 +289,10 @@ class Test:
|
|||
|
||||
assert_eq!(
|
||||
printed.as_code(),
|
||||
r#"while True:
|
||||
if something.changed:
|
||||
do.stuff() # trailing comment
|
||||
r#"for converter in connection.ops.get_db_converters(
|
||||
expression
|
||||
) + expression.get_db_converters(connection):
|
||||
...
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue