Closed
Bug 1192661
Opened 9 years ago
Closed 9 years ago
Use isort to make Python import order/style consistent
Categories
(Tree Management :: Treeherder, defect, P3)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
Details
Attachments
(1 file)
PEP8 says: """ Imports should be grouped in the following order: standard library imports related third party imports local application/library specific imports You should put a blank line between each group of imports. """ A number of times recent we've fixed import style issues here and there whilst making other changes. We should just fix this in all files in one shot to save having to do it piecemeal - particularly since there is a tool that can make the changes for us: https://github.com/timothycrosley/isort/
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8645498 -
Flags: review?(wlachance)
Comment 2•9 years ago
|
||
Comment on attachment 8645498 [details] [review] Clean up Python import order Looks reasonable. Is there a way you could hook this thing up to travis so it automagically warns if people are applying a patch that doesn't follow the recommended convention?
Attachment #8645498 -
Flags: review?(wlachance) → review+
Comment 3•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/1c00ccfcc74275f3ff7366c6150614bb065a8dc2 Bug 1192661 - Clean up Python import order Created using |isort -p tests -rc .| and a couple of manual tweaks. The order is: * futures * std library * third party packages * local imports * relative local imports ...with each group ordered with "import x" before "from x import y", and then alphabetically.
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to William Lachance (:wlach) from comment #2) > Is there a way you could hook this thing up to travis so > it automagically warns if people are applying a patch that doesn't follow > the recommended convention? Yeah there's a `--check-only` option, though it also enforces the wrapping line length part, which is more annoying - plus I can't get the --skip option to work properly. I've filed a few tickets: https://github.com/timothycrosley/isort/issues/298 https://github.com/timothycrosley/isort/issues/296 https://github.com/timothycrosley/isort/issues/297
Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•