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

Blacken source code #404

Merged
merged 3 commits into from Sep 26, 2021
Merged

Blacken source code #404

merged 3 commits into from Sep 26, 2021

Conversation

lieryan
Copy link
Member

@lieryan lieryan commented Sep 26, 2021

black currently has poor multi-line string treatment for dedent()-ed code.

I've ran aneeshusa's 'black' branch psf/black#1879
on ropetest instead, which leaves dedent()-ed lines alone while doing
all its other cleanups.

However most people likely will be running mainline black which would
have mucked the formatting in these files, so I've also added an
exclusion rule in pyproject.toml to prevent people from accidentally
auto-formatting ropetest again.

Until aneeshusa's branch are merged into mainline black, or black has a
proper solution for dedent()-ed code, be careful of running black on
ropetest.

It's fine to run mainline black on the main rope folder, just not the ropetest folder.

Credit to @climbus for bringing this topic up.

Fix #399.

@lieryan lieryan force-pushed the black2 branch 2 times, most recently from b95d3e0 to 3ed2e29 Compare September 26, 2021 01:32
black currently has poor multi-line string treatment for dedent()-ed code.

I've ran aneeshusa's 'black' branch psf/black#1879
on ropetest instead, which leaves dedent()-ed lines alone while doing
all its other cleanups.

However most people likely will be running mainline black which would
have mucked the formatting in these files, so I've also added an
exclusion rule in pyproject.toml to prevent people from accidentally
auto-formatting ropetest again.

Until aneeshusa's branch are merged into mainline black, or black has a
proper solution for dedent()-ed code, be careful of running black on
ropetest.
This prevents black reformatting commit from messing with git blame.

You may need to run the following to configure `git blame` to read the ignore
file.

    git config blame.ignoreRevsFile .git-blame-ignore-revs
@lieryan lieryan merged commit 221dec9 into master Sep 26, 2021
@lieryan lieryan deleted the black2 branch September 26, 2021 02:11
@lieryan lieryan added this to the 0.21.x milestone Sep 26, 2021
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.

Reformat code with black and add check on push
2 participants