Closed 4lm closed 4 years ago
I use pre-commit-hooks in some of my projects (Albeit not consistently on all my devices ^^'). Maybe those would be more useful. As far as I understand the proposed approach would only work in a bash shell and I do not know how well this works with this weird shell-emulator on Windows.
I quickly cobbled together an example on how this could work:
https://github.com/OpenEnergyPlatform/omi/compare/feature/code-format-pre-commit
@MGlauer. Thanks for the pre-commit-hook example, I like, will have a look into it! BTW, the Bash shell script should work under Windows, because Git uses (on Windows) the MinGW64 as shell (unix-like bash shell).
Will close this PR and will open a new one for the pre-commit-hooks branch of @MGlauer: https://github.com/OpenEnergyPlatform/omi/compare/feature/code-format-pre-commit. I will review the the new PR and if I comply will merge it ...
Hi @MGlauer,
please review this PR. I added a isort/black code formatting script (+ short usage description in readme) to be able to always run consistently over all relevant Python files after some code changes. I also included a commit https://github.com/OpenEnergyPlatform/omi/pull/17/commits/0199fcdfbea7c54875d363c494a2b5fff4bbee55 in which I added files which haven't yet been touched by isort and black