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

Fix for "# fmt: on" with decorators #1324

Closed
wants to merge 1 commit into from

Conversation

otstrel
Copy link
Contributor

@otstrel otstrel commented Mar 29, 2020

This is quick and likely dirty fix for #560. It is based on assumption that indentation has semantic meaning in Python so in case if # fmt: on exists in node children at the same column as opening # fmt: off we should process each child separately excluding only those before # fmt: on.

This seems to work for my use case which is blocking black adoption in my team and doesn't break any tests but it would be great if someone with more experience in codebase could help to polish it because I dived into black source code only two hours ago.

Thanks!

@otstrel
Copy link
Contributor Author

otstrel commented Mar 30, 2020

Submitted this one using wrong email, sorry.

@otstrel otstrel closed this Mar 30, 2020
@otstrel otstrel deleted the fix/decorator-fmt-off branch March 30, 2020 08:37
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

Successfully merging this pull request may close these issues.

1 participant