InvokeAI
InvokeAI copied to clipboard
[enhancement]: Use black & isort for code formatting.
Is there an existing issue for this?
- [X] I have searched the existing issues
Contact Details
dsully#8817, @[email protected]
What should this feature add?
I'm proposing to use black and isort via GitHub Actions to format this code base so that contributions will be consistent.
Alternatives
No response
Aditional Content
No response
Great suggestion, thank you. we can add black to the dev toolchain and have it run in the workflows at least in the --check-only mode, but i'm afraid allowing CI to commit formatted/linted changes will cause divergence between local and remote branches. For many contributors it's a high barrier to deal with, or simply too frustrating. Do you have any ideas around introducing this in a non-disruptive manner?
Are you referring to remote branches that haven't been merged yet, or something else?
Using --check in a GHA Workflow + a one time formatting. Unless you're worried about the rebasing for existing branches in this repo?
Alternatively (or perhaps in addition), using https://pre-commit.com might work well, since git doesn't have remote pre-commit hooks.
FWIW, the UI will be using a husky to format and lint via pre-commit hook. ~~It's being used in my nodes migration branch for now.~~ This is now in main.
I discussed this with @mauwii and he’s going to put in a pre-commit hook to accomplish this.
Fantastic. Let me know if I can help at all.
I did kind of a PoC here: https://github.com/mauwii/PyPatchMatch
Need some further discussions about how to integrate it into InvokeAI. Are you on our Discord @dsully?
I am, but haven't had really any time to look at it between day job and teenagers. dsully#8817
Ok, np then 😅
There has been no activity in this issue for 14 days. If this issue is still being experienced, please reply with an updated confirmation that the issue is still being experienced with the latest release.