CLI should have smart defaults
The current CLI usage is:
pre-commit disbale yaml checks jshint
pre-commit enable yaml warnings jshint
We should use "smart" defaults so yaml and checks arguments are unnecessary:
pre-commit enable jshint
But still available as options:
pre-commit disbale --yaml --warnings jshint
Not sure if this belongs in a separate issue or not but there is also the question of the terms git and yaml. They may be implementation details. We could consider different terms that specify on this machine, or repo-wide:
pre-commit enable --machine whitespace
pre-commit enable --repo whitespace
pre-commit enable --personal whitespace
pre-commit enable --shared whitespace
I shy away from the terms local and global as they are used in the git vernacular to mean "just this repo", or "all repos on this machine". The connotation we want to convey is "my machine" vs. "all developers of this repo".
it's good here, we can ad the mapping in plugins to answer to flags when given
What's up Josh?
-
I love how you opened an issue on your own repo, that's just great. :smile:
-
I'm trying to use
pre-commitagain across my team and found myself having to read the source code because the README is a bit limited and expects some background knowledge of git precommit hook terminology (e.g., "check" vs. "warning"). I thought it would be nice if a fuller YAML config could be supplied to show the various options for configuration. Personally, I think the YAML config (where you can see everything at once) beats any CLI config. The current CLI usage examples seem clunky IMO. This is super useful project, I'm very glad you're still working on this and I wanted to share my thoughts from a new user perspective. If it were me I might ditch the CLI config stuff and and just go with YAML config only (machine-wide in~/.pre-commit.ymland per-repo within the repo itselfconfig/pre-commit.yml). Just thoughts, you've obviously put a lot of time into thinking through the CLIenableanddisablestuff so maybe there is a good reason why they're in there.