pre-commit icon indicating copy to clipboard operation
pre-commit copied to clipboard

CLI should have smart defaults

Open jish opened this issue 11 years ago • 3 comments

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

jish avatar Jan 06 '14 22:01 jish

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".

jish avatar Jan 06 '14 22:01 jish

it's good here, we can ad the mapping in plugins to answer to flags when given

mpapis avatar Jan 06 '14 22:01 mpapis

What's up Josh?

  1. I love how you opened an issue on your own repo, that's just great. :smile:

  2. I'm trying to use pre-commit again 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.yml and per-repo within the repo itself config/pre-commit.yml). Just thoughts, you've obviously put a lot of time into thinking through the CLI enable and disable stuff so maybe there is a good reason why they're in there.

deepthawtz avatar Sep 17 '14 15:09 deepthawtz