InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Use black & isort for code formatting.

Open dsully opened this issue 2 years ago • 8 comments
trafficstars

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

dsully avatar Feb 05 '23 03:02 dsully

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?

ebr avatar Feb 05 '23 07:02 ebr

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.

dsully avatar Feb 05 '23 17:02 dsully

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.

psychedelicious avatar Feb 06 '23 09:02 psychedelicious

I discussed this with @mauwii and he’s going to put in a pre-commit hook to accomplish this.

lstein avatar Feb 08 '23 01:02 lstein

Fantastic. Let me know if I can help at all.

dsully avatar Feb 08 '23 02:02 dsully

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?

mauwii avatar Feb 08 '23 09:02 mauwii

I am, but haven't had really any time to look at it between day job and teenagers. dsully#8817

dsully avatar Feb 08 '23 18:02 dsully

Ok, np then 😅

mauwii avatar Feb 08 '23 18:02 mauwii

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.

github-actions[bot] avatar Mar 12 '23 06:03 github-actions[bot]