SovereignCloudStack / rookify

Enable Ceph-Cluster migrations to Rook
https://scs.community/
Apache License 2.0
1 stars 0 forks source link

Add pre-commit to project #28

Closed brueggemann closed 2 months ago

brueggemann commented 2 months ago

I think we should add pre-commit to enforce black and probably other formatting/linting to pre-commit hooks. After that some Makefile should be implemented to setup the dev environment and pre-commit install should be called there.

brueggemann commented 2 months ago

@NotTheEvilOne do you know any best practices for a requirements.txt that is only needed in dev environments? Because this PR will add pre-commit (and its dependencies) to requirement.txt. I think this is not what we want

NotTheEvilOne commented 2 months ago

Yes, requirements.txt is for the "setuptools" based build process to define all runtime requirements. Based on PEP 621 there's no defined way to accomplish this requirement as part of a "development tool set for the project".

As "pre-commit" is only relevant for Git and this upstream effort I would suggest to check for the dependency in the pre-commit Git hook itself and add a sensible error message otherwise.