Skip to content

Commit

Permalink
docs: add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Nov 30, 2023
1 parent 818b8f1 commit 654bc16
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Lefthook [supports](#config-file) YAML, JSON, and TOML configuration. In this do
- [`stage_fixed`](#stage_fixed)
- [`interactive`](#interactive)
- [`use_stdin`](#use_stdin)
- [`priority`](#priority)
- [Script](#script)
- [`runner`](#runner)
- [`skip`](#skip)
Expand Down Expand Up @@ -1093,6 +1094,35 @@ Whether to use interactive mode. This applies the certain behavior:

If you want to pass stdin to your command or script but don't need to get the input from CLI, use [`use_stdin`](#use_stdin) option instead.

### `priority`

**Default: 0**

> This option makes sense only when `parallel: false` or `piped: true` is set.

> Value `0` is considered an `+Infinity`, so commands with `priority: 0` or without this setting will be run at the very end.

Set command priority from 1 to +Infinity. This option can be used to configure the order of the sequential commands.

**Example**

```yml
# lefthook.yml
post-checkout:
piped: true
commands:
db-create:
priority: 1
run: rails db:create
db-migrate:
priority: 2
run: rails db:migrate
db-seed
priority: 3
run: rails db:seed
```

## Script

Scripts are stored under `<source_dir>/<hook-name>/` folder. These scripts are your own executables which are being run in the project root (if you don't specify a [`root`](#root) option).
Expand Down

0 comments on commit 654bc16

Please sign in to comment.