Hi Matti,

On Thu, May 5, 2022, at 22:08, Matti Picus wrote:
> This somehow runs when I do "git commit"? Do I need to add anything to 
> my git environment to pick up the hook? How do I turn it off if I find 
> it prevents progress or breaks? Do we need to add anything to the 
> documentation to warn developers about possible complications or errors?

The hook is optional, and is set up  by running pre-commit (which itself is a 
pip-installable python package):

pre-commit install

If you want to turn it off, you simply uninstall it.  `pre-commit` has a 
configuration file in which you set up all the linting-type checks you want to 
do (e.g. 
https://github.com/networkx/networkx/blob/main/.pre-commit-config.yaml).  You 
could also run the linter manually:

pre-commit run -a  (on all files)
pre-commit run filename

And this is typically what happens in the CI (except that it will only run on 
modified files).

> If it runs locally before committing, what does "enforce on CI" mean and 
> how is that different from the current linting CI job?

You run the linter on CI same as now, to ensure that all style rules are met. 
But the hook gives a developer earlier warning, so they don't have to wait for 
CI runs to complete to know they need to fix things up.

Stéfan
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to