You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a codebase that we are trying to add pre-commit to, but not everyone on the team wants or trusts the workflow. For this reason, we wanted to make it an opt-in system where by default all directories are excluded from pre-commit, except certain ones.
Ideally, we could accomplish this by being able to use the files: option at the top-level yaml. Because we cannot do this at the top level, we are forced to either add it for every single repo, or invert the value of the regular expression used in the exclude: option at the top-level.
Ergonomically, neither of these choices are good ones - the former requires many repeated files: options and is brittle, and the latter is synactically unintelligible for non-regex experts:
First, thanks for your rapid response and your project! I can already say after using it for a few days that I really like it. I can try to submit a patch, that being said, it probably won't be something I can get around to just yet since its a hectic time at work rn.
I went ahead and implemented this since it was pretty straightforward -- you should be able to try this out on master (will probably be released some time before I'm back from holiday)
Activity
asottile commentedon Nov 13, 2019
sure, would you like to work on a patch for this?
TheButlah commentedon Nov 14, 2019
First, thanks for your rapid response and your project! I can already say after using it for a few days that I really like it. I can try to submit a patch, that being said, it probably won't be something I can get around to just yet since its a hectic time at work rn.
asottile commentedon Nov 14, 2019
cool, it shouldn't be too difficult -- here's the patch that adds global
excludefor instance: https://github.com/pre-commit/pre-commit/pull/617/filesasottile commentedon Dec 23, 2019
I went ahead and implemented this since it was pretty straightforward -- you should be able to try this out on
master(will probably be released some time before I'm back from holiday)asottile commentedon Jan 2, 2020
This has been released as part of v1.21.0 -- thanks again for the issue 🎉!