Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add files, all-files and commands as flags #534

Merged
merged 4 commits into from
Aug 15, 2023
Merged

feat: add files, all-files and commands as flags #534

merged 4 commits into from
Aug 15, 2023

Conversation

nihalgonsalves
Copy link
Contributor

Closes #120

⚡ Summary

Adds --all-files, --files, and --commands to run lefthook on a subset of hooks and/or files in the repo.

New usage text:

$ lefthook run --help

Execute group of hooks

Usage:
  lefthook run hook-name [git args...] [flags]

Examples:
lefthook run pre-commit

Flags:
      --all-files          run hooks on all files
      --commands strings   run only specified commands
      --files strings      run on specified files. takes precedence over --all-files
  -h, --help               help for run
  -n, --no-tty             run hook non-interactively, disable spinner

Global Flags:
      --no-colors   disable colored output
  -v, --verbose     verbose output

☑️ Checklist

  • Check locally
  • Add tests
  • Add documentation

I'm not sure how to add a test for these - there aren't any existing tests that operate on the cmd/run.go level and test the whole flow – how would you like that to be done?

@nihalgonsalves nihalgonsalves mentioned this pull request Aug 14, 2023
3 tasks
@mrexox mrexox merged commit 48cd1be into evilmartians:master Aug 15, 2023
9 of 10 checks passed
@nihalgonsalves nihalgonsalves deleted the ng/all-files branch August 15, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: add --all-files and --files flags to the lefthook run command
2 participants