OpenEnergyPlatform / omi

Repository for the Open Metadata Integration (OMI). For metadata definition see metadata repo:
https://github.com/OpenEnergyPlatform/metadata
GNU Affero General Public License v3.0
7 stars 4 forks source link

Feature/add code formatting script #17

Closed 4lm closed 4 years ago

4lm commented 4 years ago

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

MGlauer commented 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.

MGlauer commented 4 years ago

I quickly cobbled together an example on how this could work:

https://github.com/OpenEnergyPlatform/omi/compare/feature/code-format-pre-commit

4lm commented 4 years ago

@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).

4lm commented 4 years ago

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 ...