Stream: python-questions

Topic: pre-commit exclude dir


view this post on Zulip Matt Long (Feb 11 2022 at 18:51):

I am working in a repo in which I save some cached data as zarr files. I enabled pre-commit hooks, but these are "fixing" some of the .zattrs files in my zarr archives. How do I specify a "exclude directory" for pre-commit?

view this post on Zulip Deepak Cherian (Feb 11 2022 at 18:53):

https://pre-commit.com/#creating-new-hooks. don't see directory but there is exclude_types so you could exclude *.zattrs

view this post on Zulip Matt Long (Feb 11 2022 at 18:56):

Thanks Deepak! I found this post too:
https://stackoverflow.com/questions/61032281/exclude-some-files-on-running-black-using-pre-commit

view this post on Zulip Matt Long (Feb 11 2022 at 18:57):

and that seems to work!


Last updated: May 16 2025 at 17:14 UTC