-
Notifications
You must be signed in to change notification settings - Fork 29
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
precommit (black) rebased #218
Conversation
Great 👍 .
|
72727b4
to
005ed1f
Compare
Files have not been reformatted, need to run pre-commit run -a to reformat all files with black and commit the result. flake8 should pass after this
pre-commit run --all-files
Second last commit changes the line length to 79 as suggested by @sbesson. Last commit are the manual flake8 changes required, this is because black can't split strings. |
For some background reading on the line length discussion, the 79 characters used by As we are on the process of applying black across our Python repositories, this is probably one of the few implementation decisions we will have to decide as a team. As an element of comparison, a maximal line length of 88 results in +2.5K lines while a maximal length of 79 results in +4K lines. |
I think line length of 88 is fine. It's a pain when you have things split onto more lines than necessary. I noticed that before 757a7b4 that e.g. this original code:
was changed to this (two adjacent strings) 👎
With the shorter line length it's
which is better. e.g.
|
Mark noticed several of the |
Great, so I vote for longer line length and then we can follow-up with fixing I see that when I enable "Format on Save" with black in VSCode, it also applies black to JavaScript files. I'm going to want to open new PRs soon (see #223) and to un-exclude other PRs, so hopefully we can get this merged soon? |
On balance I prefer the longer line length too, I tried the 79 limit on another repo and it seems to require more manual fixes than the default 88 |
@will-moore black is Python only, maybe vscode is using prettier? I think it's a good idea anyway |
Consensus from today's discussion to be brought to the wider community:
|
I've forced pushed the 2 line-length-79 commits away, and added |
see also: https://github.community/t/support-ignore-revs-file-in-githubs-blame-view/3256 |
Merging since this is now blocking people. My understanding is that there's a general consensus that an auto-formatter is a good way forward and will ultimately lead to less churn rather than more. The line-length seems to be the least clear option, but worst case scenario it can be reduced here in a follow up PR which should only add changed-lines as @sbesson pointed out in #218 (comment) (2.5K --> 4K) |
This is #207 with the following changes: