-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add an isort configuration #3463
Changes from 5 commits
3d3e8eb
5fc001d
5731476
ea7a787
5f8bb08
a83696b
b72b9d0
07d746b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,14 @@ max-line-length = 90 | |
# W503 requires that binary operators be at the end, not start, of lines. Erik doesn't like it. | ||
# E203 is contrary to PEP8. | ||
ignore = W503,E203 | ||
|
||
[isort] | ||
line_length = 89 | ||
not_skip = __init__.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whyso? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default, isort skips init files. We put a lot of implementation code in init files, so we have to run them on it too. |
||
sections=FUTURE,STDLIB,COMPAT,THIRDPARTY,TWISTED,FIRSTPARTY,LOCALFOLDER | ||
default_section=THIRDPARTY | ||
known_first_party = synapse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
known_compat = mock,six | ||
known_twisted=twisted,OpenSSL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely convinced about putting mock, six, twisted and OpenSSL in separate groups. What's the thinking there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reasoning for six being separate is that when we go Py3 only, that compat section gets removed (as six isn't needed and mock is in the stdlib in py3). Twisted being separate is basically aesthetics for me, I added it after a test run to see how it would look. Since we import so much from it, it just adds a bit of whitespace between all those imports and the other third party ones, otherwise the list can get pretty dense. |
||
multi_line_output=3 | ||
include_trailing_comma=true |
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.
whyso?
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.
To match our flake8 configuration, basically.