jbusecke / cookiecutter-science-project

Cookiecutter template for science analysis projects
MIT License
84 stars 13 forks source link

Added pre-commit hooks (general pre-commit hooks, black, flake8, inte… #47

Closed nenb closed 1 year ago

nenb commented 2 years ago

…rrogate, isort) for both git commit and git push. Tried to add sensible default options in setup.cfg and pyproject.toml . Made some cosmetic changes to several other files (e.g. release.yaml) so that pre-commit checks are satisfied. Also introduced some basic documentation in some files (e.g. init.py) so that interrogate check is satisfied. Made 'linting' CI workflow compulsory.

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

nenb commented 2 years ago

At the moment, I have the pre-commit hooks as mandatory for each commit and push. Perhaps this needs to be changed?

Most of the changes are cosmetic changes, so that pre-commit doesn't produce a million errors the first time a user decides to use pre-commit. I just did a pre-commit run --all-files to the original repository to produce this changes.

jbusecke commented 2 years ago

Dear @nenb, thank you so much for all this work, and my sincere apologies for not responding earlier.

At the moment, I have the pre-commit hooks as mandatory for each commit and push. Perhaps this needs to be changed?

I think I would prefer to be able to have these checks on an 'opt-in' basis indeed. Ideally I want this cookiecutter to only provide the basic file structure and then have all other features be an easy 'opt-in' with explanations.

Before I review this, I think it would be nice if we have a way to automatically build a new 'demo' repo from this cookiecutter as a part of the CI. We could force push the repo to different branches to check on all the different feature packs? What do you think?