-
Notifications
You must be signed in to change notification settings - Fork 455
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
isort: automatic formatting/sorting of imports #2819
Conversation
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Nearly perfect match config to black formatting with one exception: psf/black#251 That gap should be filled with the 'ensure_newline_before_comments=True' that won't be honored until the next version of isort. Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Ordering currently matters, so provide a script to perform it. Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
@@ -0,0 +1,7 @@ | |||
[settings] |
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.
does isort support pyproject.toml?
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.
It in fact looks like they do!
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.
the requirement for tools/format-code.sh
makes this proposal a not ideal one as everyone using a code editor could be affected and require this.
I agree, but it's not really required if following the import style guide. Regardless, it looks like |
This commit adds an isort configuration that's pretty close to black with one exception.
Add iscript config configuration that's pretty close to black with one exception. Ideally we'll enable this for a perfect match once available: isort removes newlines before standalone comments if the following line is an import of the same group psf/black#251
Add a script to format source code (tools/format-code.sh) reliably.
Add isort check (ignores whitespace) to static tests.
Actually format code. <-- this commit will need to be re-done once the current backlog of PRs is cleared (and this is ready to merge).