-
Notifications
You must be signed in to change notification settings - Fork 354
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
Small fixes for flake8 and other smaller pre-commit tools #747
Small fixes for flake8 and other smaller pre-commit tools #747
Conversation
500d25a
to
4960667
Compare
Overall +1, although can we not use prettier for markdown files? I understand consistency for code files, but feels a little too structured for my personal taste to do that on text. |
@yuvipanda note that the only markdown file we have in this project at the moment is an issue template that contains ~two actual lines: PULL_REQUEST_TEMPLATE.md If the docs would be partially or fully MyST markdown parsed in the future, I'd absolutely love to have prettier to do things in the markdown files. From past experience of having MyST markdown + prettier, I value the following from having prettier run on the markdown formatting:
|
I'm in favour of auto-formatting markdown files too, because it often turns out people do care about the formatting 😄. Line lengths are something I've often noticed- I usually add a line break at the end of sentences but others prefer to insert line breaks based on number of characters in a line. |
@manics is prettier isn't enforcing a max line length by default in markdown files though, I just verified this in z2jh. I like that it doesn't, because it is quite messy if you make a code suggestion and suddenly when it is applied you must start fix pre-commit issues or get the automatic commit pushed via pre-commit.ci automation. |
I won't be a blocker for that though :) We can nitpick the markdown rules when they come up! I'd love for this repo to be on MyST rather than rST as well. |
@yuvipanda this PR does not introduce the pre-commit configuration, it only removed two spaces in a markdown file based on prettier applied on markdown files. It is not not clear to me what if anything is requested from me as a PR author
|
60b14cc
to
a03ca44
Compare
integration-tests/test_proxy.py
Outdated
from tornado.httpclient import HTTPClientError | ||
from tornado.httpclient import HTTPRequest | ||
|
||
from tljh.config import CONFIG_DIR |
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 definitely want us to group imports - is this coming from isort? I don't think black does this.
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 is coming from reorder-python-imports by asolittle, similar to isort: https://github.com/asottile/reorder_python_imports#readme
It has been used in jupyterhub/jupyterhub, I've grown to appreciate it. Mainly because its groups the stdlib imports, third party imports, and local imports separately. The fact that it makes all imports into separate lines helps a bit with readability in my mind, but I don't care about that difference much.
I've rebased the commit applying changes from it now!
a03ca44
to
b037562
Compare
c817b5f
to
c2c4d70
Compare
@yuvipanda I've removed I've also made the pyupgrade --py36-plus hook to run on all files besides the bootstrap/bootstrap.py file that can't yet use f-strings for py35 compatibility. Are you okay with that? Related PyUpgrade team-compass issue: jupyterhub/team-compass#453, so far I've been happy about changes in jupyterhub and z2jh |
Thank you very much for removing that one, @consideRatio - I think it bothers me immensely, as I have to read through a lot of lines for not as helpful information if they're each split into one line. I wasn't aware it is now in use in JupyterHub, makes me sad :( |
Haha no worries @yuvipanda! |
As a follow-up, I've opened jupyterhub/ltiauthenticator#74 @consideRatio. |
This PR addresses changes required for the following pre-commit hooks to run properly if we add a .pre-commit-config.yaml later.
reorder-python-importsremoved on request by @yuvipandaI figure applying black would be the real big formatting change, and should be done in a dedicated PR.
I got an error that was really hard to track down by changing the order with
requirements-txt-fixer
, unsure why. I have excluded that from the PR.