-
Notifications
You must be signed in to change notification settings - Fork 155
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
enforce code format with black + isort #1738
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 have mixed feelings on this one. This is affecting the entire tree - and therefore will make all existing PRs obsolete. When I see some of the changes (e.g., https://github.com/canonical/subiquity/pull/1738/files#diff-dc9f10a528237b402741453879a9e45cc48cbc8a9d4ce289c096b41f649bb895), it doesn't necessarily feel like an improvement IMO. Can we somehow relax this by making only new code affected ?
If we are headed this direction, I would like the extra quoting in merged multi-line strings to be dropped, e.g.:
"Select one of available recovery systems and a desired " "action to execute."
If you search " "
in the code, you will find plenty of occurrences.
As you know I'm in favour of this (I expect existing PRs can be un-obsoleted by running black on them first). I agree that the joined lines are strange and should be fixed. |
Oh yeah, would it be possible to add something to CONTRIBUTING.md about how to add a pre-commit hook to enforce this? I guess I'll want something for emacs too but I'm sure I can figure that out on my own :-) |
Yes, those are pretty ugly. |
Marking draft as this requires a rebase before merge. It is otherwise reviewable. |
(I don't want to enable preview features generally, just using that for testing purposes) |
0517a52
to
5b91e36
Compare
Thanks for the excuse to learn more about these - done! |
These are now fixed in a follow-up format commit. |
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.
Thanks!
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.
Let's get this done
start a pyproject.toml file, as black will only read config from it.
All the existing environments were unused and broken. Remove them. Add black and isort environments to help run a consistent version.
We've been using the distro flake8 for some time. Also tox -e flake8 is broken. Just remove this note. Also drop unneded trailing slashes.
black will reformat this in a manner that trips flake8.
black will reformat this in a manner that trips flake8.
black will reformat this in a manner that trips flake8.
3e1173f
to
88a584e
Compare
Suggestion for reviewing this PR:
black --experimental-string-processing