-
Notifications
You must be signed in to change notification settings - Fork 599
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
Ran black on project #379
Ran black on project #379
Conversation
Hello @WillAyd! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2019-12-18 18:54:16 UTC |
Hmm yea one other conflict - flake8 defaults to 79 characters per line whereas black is 88. I typically see people update the flake8 config to allow 88 but can go either way |
@WillAyd we should have flake8/pep8 config file in the repo where the restrictions can be configured. 88 or even more characters per line seems more reasonable than 78 IMO. |
tabpy/tabpy_server/app/util.py
Outdated
return False, {} | ||
|
||
login = row[0].lower() | ||
if login in credentials: | ||
logger.error( | ||
f'Multiple entries for username {login} ' | ||
'in password file') | ||
f"Multiple entries for username {login} " "in password file" |
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.
These 2 strings should be concatenated.
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.
Nice find. Yea this is one open issue with black when you first run on a code base
from tabpy.tabpy_server.handlers.query_plane_handler import QueryPlaneHandler | ||
from tabpy.tabpy_server.handlers.service_info_handler import ServiceInfoHandler | ||
from tabpy.tabpy_server.handlers.status_handler import StatusHandler | ||
from tabpy.tabpy_server.handlers.upload_destination_handler\ | ||
import UploadDestinationHandler | ||
from tabpy.tabpy_server.handlers.upload_destination_handler import ( |
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.
Seems like () and , can be removed
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.
Unfortunately can't do that without exceeding the 88 character line limit, so black makes this a multiline import
self.error_out(400, 'Script parameters need to be ' | ||
'provided as a dictionary.') | ||
self.error_out( | ||
400, "Script parameters need to be " "provided as a dictionary." |
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.
Strings should be concatenated.
closes #364
After this would probably want to set up a CI rule to enforce. GitHub actions has a few if you wanted to use any of those:
https://github.com/marketplace?utf8=✓&type=actions&query=black
Otherwise could add to existing CI