Maybe parenthesize long constants and names (#6816)

This commit is contained in:
Micha Reiser 2023-08-24 11:47:57 +02:00 committed by GitHub
parent e4c13846e3
commit 04a9a8dd03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 357 additions and 368 deletions

View file

@ -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):
...
"#
);
}