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

Improve documentation and examples #517

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ min_version: 1.1.3

You can manage the verbosity using the `skip_output` config. You can set whether lefthook should print some parts of its output.

Possible values are `meta,success,failure,summary,execution,execution_out,skips`.
Possible values are `meta,summary,success,failure,execution,execution_out,execution_info,skips`.

This config quiets all outputs except for errors.

Expand Down
38 changes: 19 additions & 19 deletions examples/verbose/lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ pre-commit:
glob: "*.{js,ts}"
run: npx eslint --fix {staged_files} && git add {staged_files}

# `ruby-test` will skip execution only when in a merging or rebasing state.
ruby-test:
skip:
- merge
- rebase
run: bundle exec rspec
fail_text: Run bundle install
# `ruby-test` will skip execution only when in a merging or rebasing state.
ruby-test:
skip:
- merge
- rebase
run: bundle exec rspec
fail_text: Run bundle install

# `ruby-lint` has `files` option which is a git command for replacing
# the {files} template. Then lefthook applies glob pattern to the result.
# If the final list is empty, the command will be skipped.
# Otherwise the {files} templace will be replaces with list.
#
# Note: if a template has surrounding quotes, they will be used to wrap
# each file in the list.
# Double quotes `"` and single quotes `'` are supported.
ruby-lint:
glob: "*.rb"
files: git diff-tree -r --name-only --diff-filter=CDMR HEAD origin/master
run: bundle exec rubocop --force-exclusion --parallel '{files}'
# `ruby-lint` has `files` option which is a git command for replacing
# the {files} template. Then lefthook applies glob pattern to the result.
# If the final list is empty, the command will be skipped.
# Otherwise the {files} templace will be replaces with list.
#
# Note: if a template has surrounding quotes, they will be used to wrap
# each file in the list.
# Double quotes `"` and single quotes `'` are supported.
ruby-lint:
glob: "*.rb"
files: git diff-tree -r --name-only --diff-filter=CDMR HEAD origin/master
run: bundle exec rubocop --force-exclusion --parallel '{files}'

# You can provide more hooks.
pre-push:
Expand Down
Loading