-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: some small improvements and deprecation logs
- Loading branch information
Showing
10 changed files
with
106 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -376,21 +376,21 @@ remote: | |
|
||
> :test_tube: This feature is in **Beta** version | ||
|
||
You can provide multiple remotes configs if you want to share yours lefthook configurations across many projects. Lefthook will automatically download and merge configurations into your local `lefthook.yml`. | ||
You can provide multiple remote configs if you want to share yours lefthook configurations across many projects. Lefthook will automatically download and merge configurations into your local `lefthook.yml`. | ||
|
||
You can use [`extends`](#extends) related to the config file (not absolute paths). | ||
You can use [`extends`](#extends) but the paths must be relative to the remote repository root. | ||
|
||
If you provide [`scripts`](#scripts) in a remote file, the [scripts](#source_dir) folder must be in the **root of the repository**. | ||
If you provide [`scripts`](#scripts) in a remote config file, the [scripts](#source_dir) folder must also be in the **root of the repository**. | ||
|
||
**Note** | ||
|
||
Configuration in `remotes` will be merged to configuration in `lefthook.yml`, so the priority will be the following: | ||
The configuration from `remotes` will be merged to the local config using the following priority: | ||
|
||
- `lefthook.yml` | ||
- `remotes` | ||
- `lefthook-local.yml` | ||
1. Local main config (`lefthook.yml`) | ||
1. Remote configs (`remotes`) | ||
1. Local overrides (`lefthook-local.yml`) | ||
|
||
This can be changed in the future. For convenience, please use `remotes` configuration without any hooks configuration in `lefthook.yml`. | ||
This priority may be changed in the future. For convenience, if you use `remotes`, please don't configure any hooks. | ||
|
||
### `git_url` | ||
|
||
|
@@ -428,13 +428,13 @@ remotes: | |
ref: v1.0.0 | ||
``` | ||
|
||
> **Note** | ||
> :warning: **Note** | ||
> | ||
> :warning: If you initially had `ref` option, ran `lefthook install`, and then removed it, lefthook won't decide which branch/tag to use as a ref. So, if you added it once, please, use it always to avoid issues in local setups. | ||
> If you initially had `ref` option, ran `lefthook install`, and then removed it, lefthook won't decide which branch/tag to use as a ref. So, if you added it once, please, use it always to avoid issues in local setups. | ||
|
||
### `configs` | ||
|
||
**Default:** `- lefthook.yml` | ||
**Default:** `[lefthook.yml]` | ||
|
||
An optional array of config paths from remote's root. | ||
|
||
|
@@ -444,32 +444,32 @@ An optional array of config paths from remote's root. | |
# lefthook.yml | ||
remotes: | ||
- git_url: [email protected]:evilmartians/remote | ||
- git_url: [email protected]:evilmartians/lefthook | ||
ref: v1.0.0 | ||
configs: | ||
- examples/ruby-linter.yml | ||
- examples/test.yml | ||
``` | ||
|
||
More complicated example. | ||
Example with multiple remotes merging multiple configurations. | ||
|
||
```yml | ||
# lefthook.yml | ||
remotes: | ||
- git_url: [email protected]:evilmartians/remote | ||
- git_url: [email protected]:org/lefthook-configs | ||
ref: v1.0.0 | ||
configs: | ||
- examples/ruby-linter.yml | ||
- examples/test.yml | ||
- git_url : https://github.com:example/repository | ||
- git_url: https://github.com/org2/lefthook-configs | ||
configs: | ||
- lefthooks/pre_commit.yml | ||
- lefthooks/post_merge.yml | ||
- git_url : https://github.com:example2/repository2 | ||
ref: specific_branch | ||
- git_url: https://github.com/org3/lefthook-configs | ||
ref: feature/new | ||
configs: | ||
- example/pre-push.yml | ||
- configs/pre-push.yml | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,8 +433,10 @@ pre-commit: | |
SourceDir: DefaultSourceDir, | ||
SourceDirLocal: DefaultSourceDirLocal, | ||
Colors: nil, | ||
Remote: &Remote{ | ||
GitURL: "[email protected]:evilmartians/lefthook", | ||
Remotes: []*Remote{ | ||
{ | ||
GitURL: "[email protected]:evilmartians/lefthook", | ||
}, | ||
}, | ||
Hooks: map[string]*Hook{ | ||
"pre-commit": { | ||
|
@@ -488,10 +490,12 @@ pre-commit: | |
SourceDir: DefaultSourceDir, | ||
SourceDirLocal: DefaultSourceDirLocal, | ||
Colors: nil, | ||
Remote: &Remote{ | ||
GitURL: "[email protected]:evilmartians/lefthook", | ||
Ref: "v1.0.0", | ||
Config: "examples/custom.yml", | ||
Remotes: []*Remote{ | ||
{ | ||
GitURL: "[email protected]:evilmartians/lefthook", | ||
Ref: "v1.0.0", | ||
Configs: []string{"examples/custom.yml"}, | ||
}, | ||
}, | ||
Hooks: map[string]*Hook{ | ||
"pre-commit": { | ||
|
@@ -573,9 +577,11 @@ pre-push: | |
SourceDir: DefaultSourceDir, | ||
SourceDirLocal: DefaultSourceDirLocal, | ||
Colors: nil, | ||
Remote: &Remote{ | ||
GitURL: "https://github.com/evilmartians/lefthook", | ||
Config: "examples/config.yml", | ||
Remotes: []*Remote{ | ||
{ | ||
GitURL: "https://github.com/evilmartians/lefthook", | ||
Configs: []string{"examples/config.yml"}, | ||
}, | ||
}, | ||
Extends: []string{"local-extend.yml"}, | ||
Hooks: map[string]*Hook{ | ||
|
@@ -830,9 +836,9 @@ pre-commit: | |
Colors: nil, | ||
Remotes: []*Remote{ | ||
{ | ||
GitURL: "https://github.com/evilmartians/lefthook", | ||
Ref: "v1.0.0", | ||
Config: "examples/custom.yml", | ||
GitURL: "https://github.com/evilmartians/lefthook", | ||
Ref: "v1.0.0", | ||
Configs: []string{"examples/custom.yml"}, | ||
}, | ||
{ | ||
GitURL: "https://github.com/evilmartians/lefthook", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1bf3f79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great !
Thanks again for this thorough review.