You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/auto_check.md
+8-15Lines changed: 8 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,20 @@ When a commit message fails validation, Git will reject the commit and display a
10
10
11
11
There are two common methods for installing the hooks:
12
12
13
-
### Method 1: Using [pre-commit](https://pre-commit.com/) or [prek](https://prek.j178.dev) (Recommended)
13
+
### Method 1: Using pre-commit hook frameworks (Recommended)
14
14
15
-
[pre-commit](https://pre-commit.com/) and [prek](https://prek.j178.dev) are frameworks for managing and maintaining multi-language pre-commit hooks. It's the recommended approach as it handles hook installation, updates, and execution automatically.
15
+
Using pre-commit frameworks is the recommended approach as hook installation, updates, and execution are handled automatically.
16
+
These are two common pre-commit hooks:
17
+
-[prek](https://prek.j178.dev) (faster)
18
+
-[pre-commit](https://pre-commit.com/)
16
19
17
-
#### Step 1: Install pre-commit
18
-
19
-
```sh
20
-
python -m pip install pre-commit
21
-
```
22
-
23
-
or
20
+
#### Step 1: Install prek
24
21
25
22
```sh
26
23
python -m pip install prek
27
24
```
28
25
26
+
29
27
#### Step 2: Create `.pre-commit-config.yaml`
30
28
31
29
Create a `.pre-commit-config.yaml` file in your project root directory with the following content:
@@ -47,16 +45,11 @@ repos:
47
45
48
46
Install the configuration into Git's hook system:
49
47
50
-
```bash
51
-
pre-commit install --hook-type commit-msg
52
-
```
53
-
54
-
or
55
-
56
48
```bash
57
49
prek install --hook-type commit-msg
58
50
```
59
51
52
+
60
53
The hook is now active! Every time you create a commit, commitizen will automatically validate your commit message.
0 commit comments