Skip to content

Commit

Permalink
docs: Update documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox committed Nov 2, 2022
1 parent 24dcd71 commit 3f1e044
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- [`skip_output`](#skip_output)
- [`source_dir`](#source_dir)
- [`source_dir_local`](#source_dir_local)
- [`remote` (Beta :test_tube:)](#remote)
- [`git_url`](#git-url)
- [`ref`](#ref)
- [`config`](#config)
- [Hook](#git-hook)
- [`files`](#files-global)
- [`parallel`](#parallel)
Expand Down Expand Up @@ -138,6 +142,76 @@ Change a directory for *local* script files (not stored in VCS).

This option is useful if you have a `lefthook-local.yml` config file and want to reference different scripts there.

## `remote`

> :test_tube: This feature is in **Beta** version

You can provide a remote config if you want to share your lefthook configuration across many projects. Lefthook will automatically download and merge the configuration into your local `lefthook.yml`.

**Note**

Configuration in `remote` will be merged to confiuration in `lefthook.yml`, so the priority will be the following:

- `lefthook.yml`
- `remote`
- `lefthook-local.yml`

This can be changed in the future. For convenience, please use `remote` configuration without any hooks configuration in `lefthook.yml`.

### `git_url`

A URL to Git repository. It will be accessed with priveleges of the machine lefthook runs on.

**Example**

```yml
# lefthook.yml
remote:
git_url: git@github.com:evilmartians/remote
```

Or

```yml
# lefthook.yml
remote:
git_url: https://github.com/evilmartians/lefthook
```

### `ref`

An optional *branch* or *tag* name.

**Example**

```yml
# lefthook.yml
remote:
git_url: git@github.com:evilmartians/remote
ref: v1.0.0
```


### `config`

**Default:** `lefthook.yml`

An optional config path from remote's root.

**Example**

```yml
# lefthook.yml
remote:
git_url: git@github.com:evilmartians/remote
ref: v1.0.0
config: examples/ruby-linter.yml
```

## Git hook

Commands and scripts are defined for git hooks. You can defined a hook for all hooks listed in [this file](../internal/config/available_hooks.go).
Expand Down

0 comments on commit 3f1e044

Please sign in to comment.