lefthook 1.11.2 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -25
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
# Lefthook
|
|
5
5
|
|
|
6
|
-
> The fastest polyglot Git hooks manager out there
|
|
7
|
-
|
|
8
6
|
<img align="right" width="147" height="100" title="Lefthook logo"
|
|
9
7
|
src="./logo_sign.svg">
|
|
10
8
|
|
|
11
|
-
|
|
12
9
|
A Git hooks manager for Node.js, Ruby, Python and many other types of projects.
|
|
13
10
|
|
|
14
11
|
* **Fast.** It is written in Go. Can run commands in parallel.
|
|
@@ -87,12 +84,14 @@ If you want your own list. [Custom][config-files] and [prebuilt][config-run] exa
|
|
|
87
84
|
|
|
88
85
|
```yml
|
|
89
86
|
pre-commit:
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
jobs:
|
|
88
|
+
- name: lint frontend
|
|
92
89
|
run: yarn eslint {staged_files}
|
|
93
|
-
|
|
90
|
+
|
|
91
|
+
- name: lint backend
|
|
94
92
|
run: bundle exec rubocop --force-exclusion {all_files}
|
|
95
|
-
|
|
93
|
+
|
|
94
|
+
- name: stylelint frontend
|
|
96
95
|
files: git diff --name-only HEAD @{push}
|
|
97
96
|
run: yarn stylelint {files}
|
|
98
97
|
```
|
|
@@ -102,8 +101,8 @@ If you want to filter list of files. You could find more glob pattern examples [
|
|
|
102
101
|
|
|
103
102
|
```yml
|
|
104
103
|
pre-commit:
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
jobs:
|
|
105
|
+
- name: lint backend
|
|
107
106
|
glob: "*.rb" # glob filter
|
|
108
107
|
exclude: '(^|/)(application|routes)\.rb$' # regexp filter
|
|
109
108
|
run: bundle exec rubocop --force-exclusion {all_files}
|
|
@@ -114,8 +113,8 @@ If you want to execute the commands in a relative path
|
|
|
114
113
|
|
|
115
114
|
```yml
|
|
116
115
|
pre-commit:
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
jobs:
|
|
117
|
+
- name: lint backend
|
|
119
118
|
root: "api/" # Careful to have only trailing slash
|
|
120
119
|
glob: "*.rb" # glob filter
|
|
121
120
|
run: bundle exec rubocop {all_files}
|
|
@@ -127,8 +126,8 @@ If oneline commands are not enough, you can execute files. [docs][config-scripts
|
|
|
127
126
|
|
|
128
127
|
```yml
|
|
129
128
|
commit-msg:
|
|
130
|
-
|
|
131
|
-
"template_checker"
|
|
129
|
+
jobs:
|
|
130
|
+
- script: "template_checker"
|
|
132
131
|
runner: bash
|
|
133
132
|
```
|
|
134
133
|
|
|
@@ -137,13 +136,14 @@ If you want to control a group of commands. [docs][config-tags]
|
|
|
137
136
|
|
|
138
137
|
```yml
|
|
139
138
|
pre-push:
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
jobs:
|
|
140
|
+
- name: audit packages
|
|
142
141
|
tags:
|
|
143
142
|
- frontend
|
|
144
143
|
- linters
|
|
145
144
|
run: yarn lint
|
|
146
|
-
|
|
145
|
+
|
|
146
|
+
- name: audit gems
|
|
147
147
|
tags:
|
|
148
148
|
- backend
|
|
149
149
|
- security
|
|
@@ -156,8 +156,8 @@ If you are in the Docker environment. [docs][config-run]
|
|
|
156
156
|
|
|
157
157
|
```yml
|
|
158
158
|
pre-commit:
|
|
159
|
-
|
|
160
|
-
"good_job.js"
|
|
159
|
+
jobs:
|
|
160
|
+
- script: "good_job.js"
|
|
161
161
|
runner: docker run -it --rm <container_id_or_name> {cmd}
|
|
162
162
|
```
|
|
163
163
|
|
|
@@ -170,8 +170,8 @@ If you a frontend/backend developer and want to skip unnecessary commands or ove
|
|
|
170
170
|
pre-push:
|
|
171
171
|
exclude_tags:
|
|
172
172
|
- frontend
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
jobs:
|
|
174
|
+
- name: audit packages
|
|
175
175
|
skip: true
|
|
176
176
|
```
|
|
177
177
|
|
|
@@ -189,11 +189,9 @@ If you want to run specific group of commands directly.
|
|
|
189
189
|
|
|
190
190
|
```yml
|
|
191
191
|
fixer:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
js-fixer:
|
|
196
|
-
run: yarn eslint --fix {staged_files}
|
|
192
|
+
jobs:
|
|
193
|
+
- run: bundle exec rubocop --force-exclusion --safe-auto-correct {staged_files}
|
|
194
|
+
- run: yarn eslint --fix {staged_files}
|
|
197
195
|
```
|
|
198
196
|
```bash
|
|
199
197
|
$ lefthook run fixer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lefthook",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "Simple git hooks manager",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/evilmartians/lefthook#readme",
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"lefthook-darwin-arm64": "1.11.
|
|
32
|
-
"lefthook-darwin-x64": "1.11.
|
|
33
|
-
"lefthook-linux-arm64": "1.11.
|
|
34
|
-
"lefthook-linux-x64": "1.11.
|
|
35
|
-
"lefthook-freebsd-arm64": "1.11.
|
|
36
|
-
"lefthook-freebsd-x64": "1.11.
|
|
37
|
-
"lefthook-openbsd-arm64": "1.11.
|
|
38
|
-
"lefthook-openbsd-x64": "1.11.
|
|
39
|
-
"lefthook-windows-arm64": "1.11.
|
|
40
|
-
"lefthook-windows-x64": "1.11.
|
|
31
|
+
"lefthook-darwin-arm64": "1.11.3",
|
|
32
|
+
"lefthook-darwin-x64": "1.11.3",
|
|
33
|
+
"lefthook-linux-arm64": "1.11.3",
|
|
34
|
+
"lefthook-linux-x64": "1.11.3",
|
|
35
|
+
"lefthook-freebsd-arm64": "1.11.3",
|
|
36
|
+
"lefthook-freebsd-x64": "1.11.3",
|
|
37
|
+
"lefthook-openbsd-arm64": "1.11.3",
|
|
38
|
+
"lefthook-openbsd-x64": "1.11.3",
|
|
39
|
+
"lefthook-windows-arm64": "1.11.3",
|
|
40
|
+
"lefthook-windows-x64": "1.11.3"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"postinstall": "node postinstall.js"
|