Add a .pre-commit-hooks.yaml to enable hooks to refer to this repo
See original GitHub issueThe current documentation suggests to use repo: local
to use jupytext
as a pre-commit hook with pre-commit. However, this requires the user to have jupytext
installed in the environment they are working in when committing.
To avoid version conflicts etc, pre-commit usually creates a virtualenv per repo and runs the hooks from there. To do this, relies on hook providers to have a .pre-commit-hooks.yaml
file. Adding this here would allow users to use repo: https://github.com/mwouts/jupytext
to make a dedicated jupytext
environment within pre-commit, instead of relying on users to have it installed in their current env. As an added bonus, jupytext
could provide a “menu” of common hooks, if desired (e.g. “always convert .ipynb to .py”, “always unstage .ipynb”, etc). These are configurable, but not required.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (18 by maintainers)
I essentially agree. The reason for it in this case is that pre-commit doesn’t consider changes to files if they aren’t in the index, so in the PR we only put them there if they are new, and then fail the hook to alert the user.
I guess an alternative would just be to fail if the outputs aren’t tracked with some kind of warning telling the user what’s up?
What a great work done at #698! I’ll close this issue now, do some more testing/doc updates at #722, and soon we’ll be ready for a release…