|
7 | 7 |
|
8 | 8 | Enforce rules regarding frozen revisions in `.pre-commit-config.yaml`.
|
9 | 9 |
|
| 10 | +<!-- prettier-ignore-start --> |
10 | 11 | ```yaml
|
11 |
| -# Enforce frozen revisions in `.pre-commit-config.yaml` |
12 |
| -- repo: https://github.com/real-yfprojects/check-pre-commit-config |
13 |
| - rev: v1.0.0-alpha3 |
14 |
| - hooks: |
| 12 | + # Enforce frozen revisions in `.pre-commit-config.yaml` |
| 13 | + - repo: https://github.com/real-yfprojects/check-pre-commit-config |
| 14 | + rev: v1.0.0-alpha3 |
| 15 | + hooks: |
15 | 16 | - id: check-frozen
|
16 | 17 | ```
|
| 18 | +<!-- prettier-ignore-end --> |
17 | 19 |
|
18 | 20 | We advise to put this hook before any yaml formatters (like prettier) that you have configured as well.
|
19 | 21 |
|
@@ -86,31 +88,35 @@ By default `--strict --fix-all` is passed to the underlying script.
|
86 | 88 | You can customize the hooks behaviour by overriding which command line arguments
|
87 | 89 | are passed to the underlying script when the hook is run. The following configuration can be used to prevent frozen revisions from being committed:
|
88 | 90 |
|
| 91 | +<!-- prettier-ignore-start --> |
89 | 92 | ```yaml
|
90 |
| -# Prevent use of frozen revisions in `.pre-commit-config.yaml` |
91 |
| -- repo: https://github.com/real-yfprojects/check-pre-commit-config |
92 |
| - rev: v1.0.0-alpha3 |
93 |
| - hooks: |
| 93 | + # Prevent use of frozen revisions in `.pre-commit-config.yaml` |
| 94 | + - repo: https://github.com/real-yfprojects/check-pre-commit-config |
| 95 | + rev: v1.0.0-alpha3 |
| 96 | + hooks: |
94 | 97 | - id: check-frozen
|
95 | 98 | args:
|
96 |
| - - "--rules" |
97 |
| - - "ycue" |
98 |
| - - "--fix-all" |
| 99 | + - "--rules" |
| 100 | + - "ycue" |
| 101 | + - "--fix-all" |
99 | 102 | ```
|
| 103 | +<!-- prettier-ignore-end --> |
100 | 104 |
|
101 | 105 | If you just want to make sure that comments match revisions and that no abbreviated hashes are used the following configuration will be suited:
|
102 | 106 |
|
| 107 | +<!-- prettier-ignore-start --> |
103 | 108 | ```yaml
|
104 |
| -# Check use of `frozen: xxx` comments in `.pre-commit-config.yaml` |
105 |
| -- repo: https://github.com/real-yfprojects/check-pre-commit-config |
106 |
| - rev: v1.0.0-alpha3 |
107 |
| - hooks: |
| 109 | + # Check use of `frozen: xxx` comments in `.pre-commit-config.yaml` |
| 110 | + - repo: https://github.com/real-yfprojects/check-pre-commit-config |
| 111 | + rev: v1.0.0-alpha3 |
| 112 | + hooks: |
108 | 113 | - id: check-frozen
|
109 | 114 | args:
|
110 |
| - - "--rules" |
111 |
| - - "ycamet" |
112 |
| - - "--fix-all" |
| 115 | + - "--rules" |
| 116 | + - "ycamet" |
| 117 | + - "--fix-all" |
113 | 118 | ```
|
| 119 | +<!-- prettier-ignore-end --> |
114 | 120 |
|
115 | 121 | ## Contributing
|
116 | 122 |
|
|
0 commit comments