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

Modify isort config to prepare for black formatting #8332

Merged

Conversation

pierrechevalier83
Copy link
Contributor

Problem

Currently, the formatting situation in the python code is quite painful as it involves manual formatting of code.
I would like to replace our current workflow with one involving Black in a subsequent PR (see motivations for the choice over there).
Black is opinionated about code layout, so with our current settings, Black and isort would be having minor opinion differences.

Solution

Modify the isort configuration to bend to Black's taste.

Result

Once we run Black on the codebase with a minimal configuration, isort will be happy with the results.

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding John/Benjy to give their go-ahead on Black, since I didn't see their responses to the thread you started.

.isort.cfg Outdated
@@ -3,6 +3,10 @@

[settings]
line_length=100
multi_line_outddput=3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like a valid setting?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and that's why all these files are formatted wrong! https://github.com/psf/black#how-black-wraps-lines

@stuhood stuhood requested review from benjyw and jsirois September 26, 2019 04:22
Copy link
Contributor

@jsirois jsirois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy enough to have black and thus happy for the prep work. Stu's eye caught a bug that would have led to thrash so that needs to be fixed up.

.isort.cfg Outdated
@@ -3,6 +3,10 @@

[settings]
line_length=100
multi_line_outddput=3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and that's why all these files are formatted wrong! https://github.com/psf/black#how-black-wraps-lines

@pierrechevalier83 pierrechevalier83 force-pushed the pchevalier/pre_black/isort branch from 6af958f to 34efe0a Compare September 26, 2019 10:54
@pierrechevalier83
Copy link
Contributor Author

Good catch on the typo, @stuhood and @jsirois ! Thanks 😄 Should be good to go now.

@pierrechevalier83
Copy link
Contributor Author

Note: this is one of the prerequisites for #8334

@illicitonion illicitonion merged commit 44d4ab5 into pantsbuild:master Sep 27, 2019
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.

4 participants