|
1 | 1 | # To run pre-commit hooks, first install pre-commit:
|
2 | 2 | # - `pip install pre-commit==${PRE_COMMIT_VERSION}`
|
3 |
| -# - `pip install pre-commit-hooks==${PRE_COMMIT_HOOKS_VERSION}` |
4 |
| -# |
5 |
| -# Depending on your system, you can use `brew install` or `apt install` as well |
6 |
| -# for installing the pre-commit package, but `pip` is needed to install the |
7 |
| -# hooks; you can also use `pipx` if you prefer. |
8 |
| -# Next, install the required formatters: |
9 |
| -# - `pip install clang-format==${CLANG_VERSION}` |
10 |
| -# - `npm install prettier@${PRETTIER_VERSION}` |
11 |
| -# |
12 |
| -# See https://github.com/XRPLF/ci/blob/main/.github/workflows/tools-rippled.yml |
13 |
| -# for the versions used in the CI pipeline. You will need to have the exact same |
14 |
| -# versions of the tools installed on your system to produce the same results as |
15 |
| -# the pipeline. |
16 | 3 | #
|
17 | 4 | # Then, run the following command to install the git hook scripts:
|
18 | 5 | # - `pre-commit install`
|
19 | 6 | # You can run all configured hooks against all files with:
|
20 | 7 | # - `pre-commit run --all-files`
|
21 | 8 | # To manually run a specific hook, use:
|
22 | 9 | # - `pre-commit run <hook_id> --all-files`
|
23 |
| -# To run the hooks against only the files changed in the current commit, use: |
| 10 | +# To run the hooks against only the staged files, use: |
24 | 11 | # - `pre-commit run`
|
25 | 12 | repos:
|
26 |
| - - repo: local |
| 13 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 14 | + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 |
27 | 15 | hooks:
|
28 |
| - - id: clang-format |
29 |
| - name: clang-format |
30 |
| - language: system |
31 |
| - entry: clang-format -i |
32 |
| - files: '\.(cpp|hpp|h|ipp|proto)$' |
33 | 16 | - id: trailing-whitespace
|
34 |
| - name: trailing-whitespace |
35 |
| - entry: trailing-whitespace-fixer |
36 |
| - language: system |
37 |
| - types: [text] |
38 |
| - - id: end-of-file |
39 |
| - name: end-of-file |
40 |
| - entry: end-of-file-fixer |
41 |
| - language: system |
42 |
| - types: [text] |
| 17 | + - id: end-of-file-fixer |
43 | 18 | - id: mixed-line-ending
|
44 |
| - name: mixed-line-ending |
45 |
| - entry: mixed-line-ending |
46 |
| - language: system |
47 |
| - types: [text] |
48 | 19 | - id: check-merge-conflict
|
49 |
| - name: check-merge-conflict |
50 |
| - entry: check-merge-conflict --assume-in-merge |
51 |
| - language: system |
52 |
| - types: [text] |
53 |
| - - repo: local |
| 20 | + args: [--assume-in-merge] |
| 21 | + |
| 22 | + - repo: https://github.com/pre-commit/mirrors-clang-format |
| 23 | + rev: 7d85583be209cb547946c82fbe51f4bc5dd1d017 # frozen: v18.1.8 |
| 24 | + hooks: |
| 25 | + - id: clang-format |
| 26 | + args: [--style=file] |
| 27 | + "types_or": [c++, c, proto] |
| 28 | + |
| 29 | + - repo: https://github.com/rbubley/mirrors-prettier |
| 30 | + rev: 5ba47274f9b181bce26a5150a725577f3c336011 # frozen: v3.6.2 |
54 | 31 | hooks:
|
55 | 32 | - id: prettier
|
56 |
| - name: prettier |
57 |
| - language: system |
58 |
| - entry: prettier --ignore-unknown --write |
59 | 33 |
|
60 | 34 | exclude: |
|
61 | 35 | (?x)^(
|
|
0 commit comments