Skip to content
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

dedent_closing_brackets not working for Annotations[] #1200

Open
difhel opened this issue Feb 8, 2024 · 0 comments
Open

dedent_closing_brackets not working for Annotations[] #1200

difhel opened this issue Feb 8, 2024 · 0 comments

Comments

@difhel
Copy link

difhel commented Feb 8, 2024

My config:

[tool.yapf]
based_on_style = "google"
dedent_closing_brackets = true
coalesce_brackets = true

Generated diff:

+++ ./src/db/models/annotations/__init__.py	(reformatted)
@@ -7,6 +7,8 @@
 EmailAnnotation = Annotated[str, AfterValidator(validators.email_string)]
 DomainAnnotation = Annotated[str, AfterValidator(validators.domain_name)]
 NameAnnotation = Annotated[str, AfterValidator(validators.name_string)]
-DescriptionAnnotation = Annotated[str, AfterValidator(validators.description_string)]
-RoleCodeAnnotation = Annotated[int, AfterValidator(validators.not_negative_number)]
+DescriptionAnnotation = Annotated[str,
+                                  AfterValidator(validators.description_string)]
+RoleCodeAnnotation = Annotated[int,
+                               AfterValidator(validators.not_negative_number)]
 StrIdAnnotation = Annotated[str, AfterValidator(validators.string_id)]

I want to work this feature similar to how it works with functions:

- function(long_param_a, long_param_b, long_param_c)
+ function(
+     long_param_a,
+     long_param_b,
+     long_param_c,
+     long_param_d
+ )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant