-
-
Notifications
You must be signed in to change notification settings - Fork 90
Implement Python formatting with black #720
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
Conversation
| @@ -0,0 +1,20 @@ | |||
| #!/usr/bin/env bash | |||
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.
This is for local execution. See package.json.
| gi.require_version("Adw", "1") | ||
| from gi.repository import Gtk, Adw | ||
| import workbench | ||
|
|
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.
This is the pre-commit hook doing its magic :)
sonnyp
left a comment
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.
One more thing I forgot, could you add a check to make lint (Makefile) that errors if the code isn't formatted ?
This runs as part of github workflow
| of black and their dependencies and add them to the JSON as well. Brute-forcing the build to obtain missing packages | ||
| may help as does referencing old commits of the file. You can also use the generator command to generate dependencies | ||
| for them and then merge it into the file by hand, but note that you will also need to manually collect their build | ||
| dependencies too. |
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.
excellent doc 👌
thank you
| fi | ||
| fi | ||
|
|
||
| exec black "$@" |
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.
Ideally we would use Flatpak
Could black be part of a Python sdk at some point?
An other option is to build the Workbench Flatpak once before running the pre-commits
And using the tooling from within the Workbench runtime
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.
Would probably be useful to have in the SDK. I feel like pre-building the Workbench Flatpak is a bit convoluted and error prone.
|
Nevermind - it's already there :) |
sonnyp
left a comment
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.
Great work!
I hope the README.md I added is OK, it's a bit of an unfortunate situation but it wasn't too bad to get it working.
Closes #716