-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
replace flake8 sorter with isort #242
Conversation
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'm +1 on isort
Unfortunately isort’s output is not deterministic. It depends on what packages you have installed, your working directory and probably other factors. The build is now failing even though I ran the blacken session locally. I will have to follow up here. One solution may just be to remove the isort check from nox’s lint session. Not sure if it should be left in blacken since it may be different every time someone else runs it. |
I'm in favor of removing the isort call from the lint session.
…On Tue, Aug 27, 2019 at 10:05 PM Chad Smith ***@***.***> wrote:
Unfortunately isort’s output is not deterministic. It depends on what
packages you have installed, your working directory and probably other
factors. The build is now failing even though I ran the blacken session
locally. I will have to follow back up here. One solution may just be to
remove the isort check from nox’s lint session.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#242>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB5I42QL3PQM3E5UIXARLLQGYBR3ANCNFSM4IP5IZ4A>
.
|
Removed isort check in lint session. |
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.
👍
noxfile.py
Outdated
@@ -59,16 +58,19 @@ def cover(session): | |||
@nox.session(python="3.7") | |||
def blacken(session): | |||
"""Run black code formater.""" | |||
session.install("black") | |||
session.run("black", "nox", "tests", "noxfile.py", "setup.py") | |||
session.install("black", "isort==4.3.21") |
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.
Any reason to only pin isort?
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 pinned it because I thought it would fix the discrepancy between me running it locally and the CI check, but it didn't. Still, it might help keep the sort order more consistent between runs. I don't really feel strongly either way.
tbh we should pin all of the lint/format tools so that contributors don't
get tangled in unrelated style updates.
…On Wed, Aug 28, 2019 at 9:40 AM Chad Smith ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In noxfile.py
<#242 (comment)>:
> @@ -59,16 +58,19 @@ def cover(session):
@nox.session(python="3.7")
def blacken(session):
"""Run black code formater."""
- session.install("black")
- session.run("black", "nox", "tests", "noxfile.py", "setup.py")
+ session.install("black", "isort==4.3.21")
I pinned it because I thought it would fix the discrepancy between me
running it locally and the CI check, but it didn't. Still, it might help
keep the sort order more consistent between runs. I don't really feel
strongly either way.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#242>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB5I43BMNKFHVHYONEQDHLQG2S6PANCNFSM4IP5IZ4A>
.
|
There is no easy way to automatically satisfy flake8's linting requirements for sort order. Using isort there is.
I ran
to automatically sort imports. Then I updated noxfile to test with isort rather than flake8.