|
1 | 1 | # See https://pre-commit.com for more information
|
2 | 2 | # See https://pre-commit.com/hooks.html for more hooks
|
3 | 3 | repos:
|
4 |
| - - repo: https://github.com/psf/black |
5 |
| - rev: 23.1.0 |
6 |
| - hooks: |
7 |
| - - id: black |
8 |
| - args: |
9 |
| - - --quiet |
10 |
| - files: ^(matter_server|scripts)/.+\.py$ |
11 |
| - - repo: https://github.com/codespell-project/codespell |
12 |
| - rev: v2.2.4 |
| 4 | + - repo: local |
13 | 5 | hooks:
|
| 6 | + - id: ruff-check |
| 7 | + name: 🐶 Ruff Linter |
| 8 | + language: system |
| 9 | + types: [python] |
| 10 | + entry: scripts/run-in-env.sh ruff check --fix |
| 11 | + require_serial: true |
| 12 | + stages: [commit, push, manual] |
| 13 | + - id: ruff-format |
| 14 | + name: 🐶 Ruff Formatter |
| 15 | + language: system |
| 16 | + types: [python] |
| 17 | + entry: scripts/run-in-env.sh ruff format |
| 18 | + require_serial: true |
| 19 | + stages: [commit, push, manual] |
| 20 | + - id: check-ast |
| 21 | + name: 🐍 Check Python AST |
| 22 | + language: system |
| 23 | + types: [python] |
| 24 | + entry: scripts/run-in-env.sh check-ast |
| 25 | + - id: check-case-conflict |
| 26 | + name: 🔠 Check for case conflicts |
| 27 | + language: system |
| 28 | + entry: scripts/run-in-env.sh check-case-conflict |
| 29 | + - id: check-docstring-first |
| 30 | + name: ℹ️ Check docstring is first |
| 31 | + language: system |
| 32 | + types: [python] |
| 33 | + entry: scripts/run-in-env.sh check-docstring-first |
| 34 | + - id: check-executables-have-shebangs |
| 35 | + name: 🧐 Check that executables have shebangs |
| 36 | + language: system |
| 37 | + types: [text, executable] |
| 38 | + entry: scripts/run-in-env.sh check-executables-have-shebangs |
| 39 | + stages: [commit, push, manual] |
| 40 | + - id: check-json |
| 41 | + name: { Check JSON files |
| 42 | + language: system |
| 43 | + types: [json] |
| 44 | + entry: scripts/run-in-env.sh check-json |
| 45 | + - id: check-merge-conflict |
| 46 | + name: 💥 Check for merge conflicts |
| 47 | + language: system |
| 48 | + types: [text] |
| 49 | + entry: scripts/run-in-env.sh check-merge-conflict |
| 50 | + - id: check-symlinks |
| 51 | + name: 🔗 Check for broken symlinks |
| 52 | + language: system |
| 53 | + types: [symlink] |
| 54 | + entry: scripts/run-in-env.sh check-symlinks |
| 55 | + - id: check-toml |
| 56 | + name: ✅ Check TOML files |
| 57 | + language: system |
| 58 | + types: [toml] |
| 59 | + entry: scripts/run-in-env.sh check-toml |
14 | 60 | - id: codespell
|
15 |
| - args: [] |
16 |
| - exclude_types: [csv, json] |
17 |
| - exclude: ^tests/fixtures/ |
18 |
| - additional_dependencies: |
19 |
| - - tomli |
20 |
| - - repo: https://github.com/PyCQA/flake8 |
21 |
| - rev: 6.0.0 |
22 |
| - hooks: |
23 |
| - - id: flake8 |
24 |
| - files: ^(matter_server|scripts)/.+\.py$ |
25 |
| - - repo: https://github.com/PyCQA/isort |
26 |
| - rev: 5.12.0 |
27 |
| - hooks: |
28 |
| - - id: isort |
29 |
| - files: ^(matter_server|scripts)/.+\.py$ |
30 |
| - - repo: https://github.com/pre-commit/pre-commit-hooks |
31 |
| - rev: v4.4.0 |
32 |
| - hooks: |
| 61 | + name: ✅ Check code for common misspellings |
| 62 | + language: system |
| 63 | + types: [text] |
| 64 | + entry: scripts/run-in-env.sh codespell |
| 65 | + - id: detect-private-key |
| 66 | + name: 🕵️ Detect Private Keys |
| 67 | + language: system |
| 68 | + types: [text] |
| 69 | + entry: scripts/run-in-env.sh detect-private-key |
| 70 | + - id: end-of-file-fixer |
| 71 | + name: ⮐ Fix End of Files |
| 72 | + language: system |
| 73 | + types: [text] |
| 74 | + entry: scripts/run-in-env.sh end-of-file-fixer |
| 75 | + stages: [commit, push, manual] |
33 | 76 | - id: no-commit-to-branch
|
| 77 | + name: 🛑 Don't commit to main branch |
| 78 | + language: system |
| 79 | + entry: scripts/run-in-env.sh no-commit-to-branch |
| 80 | + pass_filenames: false |
| 81 | + always_run: true |
34 | 82 | args:
|
35 | 83 | - --branch=main
|
| 84 | + - id: pylint |
| 85 | + name: 🌟 Starring code with pylint |
| 86 | + language: system |
| 87 | + types: [python] |
| 88 | + entry: scripts/run-in-env.sh pylint |
36 | 89 | - id: trailing-whitespace
|
37 |
| - - repo: local |
38 |
| - hooks: |
| 90 | + name: ✄ Trim Trailing Whitespace |
| 91 | + language: system |
| 92 | + types: [text] |
| 93 | + entry: scripts/run-in-env.sh trailing-whitespace-fixer |
| 94 | + stages: [commit, push, manual] |
39 | 95 | - id: mypy
|
40 | 96 | name: mypy
|
41 | 97 | entry: scripts/run-in-env.sh mypy
|
42 |
| - types: [python] |
43 | 98 | language: script
|
44 |
| - files: ^(matter_server)/.+\.py$ |
45 |
| - |
46 |
| - - id: pylint |
47 |
| - name: pylint |
48 |
| - entry: scripts/run-in-env.sh pylint -j 0 |
49 | 99 | types: [python]
|
50 |
| - language: script |
51 |
| - files: ^(matter_server)/.+\.py$ |
| 100 | + require_serial: true |
| 101 | + files: ^(matter_server|pylint)/.+\.py$ |
0 commit comments