-
Notifications
You must be signed in to change notification settings - Fork 9
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 #24
ISort #24
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 may have missed a few instances of the logger, but it should be below all the imports.
bin/contact-search-backfill
Outdated
@@ -1,14 +1,16 @@ | |||
#!/usr/bin/env python | |||
import click |
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.
Click should be moved down since monkey.patch_all()
should be the first thing.
|
||
import click | ||
import gevent_openssl | ||
from setproctitle import setproctitle | ||
|
||
gevent_openssl.monkey_patch() |
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.
While this script is probably not used at all, ideally the only import above this line would be gevent_openssl
.
inbox/api/update.py
Outdated
from nylas.logging import get_logger | ||
from sqlalchemy.orm.exc import NoResultFound | ||
|
||
log = get_logger() |
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.
Can probably move this below the imports?
inbox/models/roles.py
Outdated
from nylas.logging import get_logger | ||
from sqlalchemy import Column, Integer, String | ||
|
||
log = get_logger() |
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.
Move logger down?
inbox/models/thread.py
Outdated
) | ||
|
||
from nylas.logging import get_logger | ||
|
||
log = get_logger() |
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.
Move logger down?
inbox/transactions/actions.py
Outdated
from nylas.logging import get_logger | ||
from nylas.logging.sentry import log_uncaught_errors | ||
from sqlalchemy import desc | ||
|
||
logger = get_logger() |
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.
Move logger down?
Do we want to change functionality with this PR? I had intentionally not moved any of the statements relative to import groups so as to not accidentally change any functionality impacted by these statements. |
I wouldn't consider this "changing functionality". We want to make sure imports are properly sorted, and I'd say this means we should move statements in between top-level imports to where they belong. |
Alright, I've moved the logging configuration everywhere I saw it out of place in this PR's diff. |
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.
just minor comment
from gevent import monkey | ||
|
||
monkey.patch_all() | ||
import gevent_openssl | ||
|
||
gevent_openssl.monkey_patch() | ||
|
||
import click |
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.
Could we have a newline above this import (and above import gevent_openssl
)? This applies in a few other cases within this commit as well.
Related: #12
This change:
isort
devtools
container todocker-compose.yml
for runningblack
andisort