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 #1325

Merged
merged 3 commits into from May 8, 2020

Conversation

otstrel
Copy link
Contributor

@otstrel otstrel commented Mar 30, 2020

Re-submitting #1324 using correct email.

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 otstrel closed this Apr 5, 2020
@otstrel otstrel reopened this Apr 5, 2020
@autophagy autophagy self-requested a review May 8, 2020 12:09
@ambv
Copy link
Collaborator

ambv commented May 8, 2020

Let's merge this. I'll need:

  • fmt_on changed to is_fmt_on
  • the new functions added to the docs
  • the change added to the changelog

@autophagy autophagy merged commit 892edda into psf:master May 8, 2020
autophagy added a commit that referenced this pull request May 8, 2020
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
autophagy added a commit that referenced this pull request May 8, 2020
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
autophagy added a commit that referenced this pull request May 8, 2020
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
autophagy added a commit that referenced this pull request May 8, 2020
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
autophagy added a commit that referenced this pull request May 8, 2020
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
@otstrel
Copy link
Contributor Author

otstrel commented May 9, 2020

Thanks a lot! #560 can be closed now I guess.

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.

None yet

3 participants