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
Add isort to code formatting and CI #1933
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1933 +/- ##
========================================
Coverage 76.97% 76.97%
========================================
Files 55 55
Lines 4704 4704
========================================
Hits 3621 3621
Misses 1083 1083
Continue to review full report at Codecov.
|
Is there any way to get access to the circleci failure messages without giving access to circleci to all of my repositories? I want to confirm that the failures are as expected before proceeding. |
Also I added the |
I thought CircleCI would allow anyone to browse the results, but I see that it asks me to login when clicking into the job details :-/ If you really don't want to login, here are the gist of the output from the test run:
Since isort got support for Black, I guess we can replace the following in
With just:
|
@@ -12,6 +12,6 @@ multi_line_output = 3 | |||
include_trailing_comma = true | |||
force_grid_wrap = 0 | |||
use_parentheses = true | |||
line_length = 88 | |||
line_length = 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is configured to 88 because that's the max limit Black allows when it is configured to try to keep to 80.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project has changed the default black line length, which requires this change in isort too.
Line 7 in 8954abc
line-length = 80 |
Let me test profile=black
add above and see if it uses the black config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you are saying now, but black failed when using line-length=88
in isort.
Thanks for following up. These are the expected failures, so we know that it fails correctly. |
I've tested both Now I'm getting errors for the flake8 check for third-party libs that I need to look into. |
Sorry for all the pushes, but sometimes the CI behavior of isort and flake8 can differ compared to the local behavior. I wanted to make sure I was on the right path before continuing. The final piece is that flake8-import-order is not compatible with isort, so I switched it for flake8-isort. I also added it to the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great :-)
Thank you! |
Fixes #1919
I'm starting this PR with adding CI for isort, which is already installed in the lint environment and already has some configuration in the repository.
Made the line length 80 to match the black setting.
Once it is confirmed that the CI works as expected, i.e. fails, I will push the next commit with the isort changes.