-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update Black tests #13375
Update Black tests #13375
Conversation
-type something_that_is_long[ | ||
- something_that_is_long = something_that_is_long | ||
-] = something_that_is_long | ||
+type something_that_is_long[something_that_is_long = something_that_is_long] = ( | ||
+ something_that_is_long | ||
+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer Ruff's formatting here which is more in line with other assignment formatting where the preference is to break the right side before breaking the left.
+def simple[T = something_that_is_long]( | ||
+ short1: int, short2: str, short3: bytes | ||
+) -> float: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer Ruff's formatting here. Breaking the return type and arguments is more readable than breaking the type arguments (overall, prefer breaking the right before breaking the left)
|
||
f"{1:{f'{2}'}}" | ||
-f"{1:{f'{2}'}}" | ||
+f'{1:{f'{2}'}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to #13237
- case "test" if ( | ||
- "any long condition" != "another long condition" and "this is a long condition" | ||
- ): | ||
+ case "test" if "any long condition" != "another long condition" and "this is a long condition": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to new preview style that parenthesizes long if conditions.
- | memoryview | ||
- # comment with non-return annotation | ||
- ), | ||
+ # comment with non-return annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ | ||
# | ||
-# | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruff does not support form feed characters.
@konstin I think you were right on the on-site. It's form feed characters :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we would, but maybe we only added this for the linter? #7489
|
||
class ClassC: | ||
def f(self): | ||
- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruff does not preserve empty lines at the beginning of a class (intentional decision)
+def bobtwo(): | ||
+ # some comment here | ||
def bobtwo(): | ||
- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruff does not preserve empty lines between the class and any leading comment (intentional decision)
+++ Ruff | ||
@@ -1,5 +1,4 @@ | ||
class Plotter: | ||
- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruff does not preserve empty lines after a class (intentional deviation)
|
Summary
Pull in the latest black snapshot tests
Test Plan
cargo test
. I reviewed the new snapshot tests