@evilmartians/lefthook-installer 1.11.2 → 1.11.4
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 +30 -26
- package/package.json +1 -1
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.
|
|
@@ -22,12 +19,18 @@ A Git hooks manager for Node.js, Ruby, Python and many other types of projects.
|
|
|
22
19
|
|
|
23
20
|
## Install
|
|
24
21
|
|
|
25
|
-
With **Go** (>= 1.
|
|
22
|
+
With **Go** (>= 1.24):
|
|
26
23
|
|
|
27
24
|
```bash
|
|
28
25
|
go install github.com/evilmartians/lefthook@latest
|
|
29
26
|
```
|
|
30
27
|
|
|
28
|
+
* or as a go tool
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
go get -tool github.com/evilmartians/lefthook
|
|
32
|
+
```
|
|
33
|
+
|
|
31
34
|
With **NPM**:
|
|
32
35
|
|
|
33
36
|
```bash
|
|
@@ -87,12 +90,14 @@ If you want your own list. [Custom][config-files] and [prebuilt][config-run] exa
|
|
|
87
90
|
|
|
88
91
|
```yml
|
|
89
92
|
pre-commit:
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
jobs:
|
|
94
|
+
- name: lint frontend
|
|
92
95
|
run: yarn eslint {staged_files}
|
|
93
|
-
|
|
96
|
+
|
|
97
|
+
- name: lint backend
|
|
94
98
|
run: bundle exec rubocop --force-exclusion {all_files}
|
|
95
|
-
|
|
99
|
+
|
|
100
|
+
- name: stylelint frontend
|
|
96
101
|
files: git diff --name-only HEAD @{push}
|
|
97
102
|
run: yarn stylelint {files}
|
|
98
103
|
```
|
|
@@ -102,8 +107,8 @@ If you want to filter list of files. You could find more glob pattern examples [
|
|
|
102
107
|
|
|
103
108
|
```yml
|
|
104
109
|
pre-commit:
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
jobs:
|
|
111
|
+
- name: lint backend
|
|
107
112
|
glob: "*.rb" # glob filter
|
|
108
113
|
exclude: '(^|/)(application|routes)\.rb$' # regexp filter
|
|
109
114
|
run: bundle exec rubocop --force-exclusion {all_files}
|
|
@@ -114,8 +119,8 @@ If you want to execute the commands in a relative path
|
|
|
114
119
|
|
|
115
120
|
```yml
|
|
116
121
|
pre-commit:
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
jobs:
|
|
123
|
+
- name: lint backend
|
|
119
124
|
root: "api/" # Careful to have only trailing slash
|
|
120
125
|
glob: "*.rb" # glob filter
|
|
121
126
|
run: bundle exec rubocop {all_files}
|
|
@@ -127,8 +132,8 @@ If oneline commands are not enough, you can execute files. [docs][config-scripts
|
|
|
127
132
|
|
|
128
133
|
```yml
|
|
129
134
|
commit-msg:
|
|
130
|
-
|
|
131
|
-
"template_checker"
|
|
135
|
+
jobs:
|
|
136
|
+
- script: "template_checker"
|
|
132
137
|
runner: bash
|
|
133
138
|
```
|
|
134
139
|
|
|
@@ -137,13 +142,14 @@ If you want to control a group of commands. [docs][config-tags]
|
|
|
137
142
|
|
|
138
143
|
```yml
|
|
139
144
|
pre-push:
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
jobs:
|
|
146
|
+
- name: audit packages
|
|
142
147
|
tags:
|
|
143
148
|
- frontend
|
|
144
149
|
- linters
|
|
145
150
|
run: yarn lint
|
|
146
|
-
|
|
151
|
+
|
|
152
|
+
- name: audit gems
|
|
147
153
|
tags:
|
|
148
154
|
- backend
|
|
149
155
|
- security
|
|
@@ -156,8 +162,8 @@ If you are in the Docker environment. [docs][config-run]
|
|
|
156
162
|
|
|
157
163
|
```yml
|
|
158
164
|
pre-commit:
|
|
159
|
-
|
|
160
|
-
"good_job.js"
|
|
165
|
+
jobs:
|
|
166
|
+
- script: "good_job.js"
|
|
161
167
|
runner: docker run -it --rm <container_id_or_name> {cmd}
|
|
162
168
|
```
|
|
163
169
|
|
|
@@ -170,8 +176,8 @@ If you a frontend/backend developer and want to skip unnecessary commands or ove
|
|
|
170
176
|
pre-push:
|
|
171
177
|
exclude_tags:
|
|
172
178
|
- frontend
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
jobs:
|
|
180
|
+
- name: audit packages
|
|
175
181
|
skip: true
|
|
176
182
|
```
|
|
177
183
|
|
|
@@ -189,11 +195,9 @@ If you want to run specific group of commands directly.
|
|
|
189
195
|
|
|
190
196
|
```yml
|
|
191
197
|
fixer:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
js-fixer:
|
|
196
|
-
run: yarn eslint --fix {staged_files}
|
|
198
|
+
jobs:
|
|
199
|
+
- run: bundle exec rubocop --force-exclusion --safe-auto-correct {staged_files}
|
|
200
|
+
- run: yarn eslint --fix {staged_files}
|
|
197
201
|
```
|
|
198
202
|
```bash
|
|
199
203
|
$ lefthook run fixer
|