|
1 | 1 | --- |
2 | 2 | repos: |
3 | | - - repo: https://github.com/PyCQA/bandit |
4 | | - rev: 1.6.2 |
5 | | - hooks: |
6 | | - - id: bandit |
7 | | - args: |
8 | | - - --quiet |
9 | | - - --format=custom |
10 | | - - --configfile=.bandit.yaml |
11 | | - files: ^pyhilo/.+\.py$ |
12 | | - - repo: https://github.com/python/black |
13 | | - rev: 22.12.0 |
14 | | - hooks: |
15 | | - - id: black |
16 | | - args: |
17 | | - - --safe |
18 | | - - --quiet |
19 | | - language_version: python3 |
20 | | - files: ^((pyhilo|tests)/.+)?[^/]+\.py$ |
21 | | - - repo: https://github.com/codespell-project/codespell |
22 | | - rev: v1.16.0 |
| 3 | + - repo: local |
23 | 4 | hooks: |
| 5 | + - id: ruff-check |
| 6 | + name: 🐶 Ruff Linter |
| 7 | + language: system |
| 8 | + types: [python] |
| 9 | + entry: poetry run ruff check --fix |
| 10 | + require_serial: true |
| 11 | + stages: [pre-commit, pre-push, manual] |
| 12 | + - id: ruff-format |
| 13 | + name: 🐶 Ruff Formatter |
| 14 | + language: system |
| 15 | + types: [python] |
| 16 | + entry: poetry run ruff format |
| 17 | + require_serial: true |
| 18 | + stages: [pre-commit, pre-push, manual] |
| 19 | + - id: check-ast |
| 20 | + name: 🐍 Check Python AST |
| 21 | + language: system |
| 22 | + types: [python] |
| 23 | + entry: poetry run check-ast |
| 24 | + - id: check-case-conflict |
| 25 | + name: 🔠 Check for case conflicts |
| 26 | + language: system |
| 27 | + entry: poetry run check-case-conflict |
| 28 | + - id: check-docstring-first |
| 29 | + name: ℹ️ Check docstring is first |
| 30 | + language: system |
| 31 | + types: [python] |
| 32 | + entry: poetry run check-docstring-first |
| 33 | + - id: check-executables-have-shebangs |
| 34 | + name: 🧐 Check that executables have shebangs |
| 35 | + language: system |
| 36 | + types: [text, executable] |
| 37 | + entry: poetry run check-executables-have-shebangs |
| 38 | + stages: [pre-commit, pre-push, manual] |
| 39 | + - id: check-json |
| 40 | + name: { Check JSON files |
| 41 | + language: system |
| 42 | + types: [json] |
| 43 | + entry: poetry run check-json |
| 44 | + - id: check-merge-conflict |
| 45 | + name: 💥 Check for merge conflicts |
| 46 | + language: system |
| 47 | + types: [text] |
| 48 | + entry: poetry run check-merge-conflict |
| 49 | + - id: check-symlinks |
| 50 | + name: 🔗 Check for broken symlinks |
| 51 | + language: system |
| 52 | + types: [symlink] |
| 53 | + entry: poetry run check-symlinks |
| 54 | + - id: check-toml |
| 55 | + name: ✅ Check TOML files |
| 56 | + language: system |
| 57 | + types: [toml] |
| 58 | + entry: poetry run check-toml |
| 59 | + - id: check-xml |
| 60 | + name: ✅ Check XML files |
| 61 | + entry: check-xml |
| 62 | + language: system |
| 63 | + types: [xml] |
| 64 | + - id: check-yaml |
| 65 | + name: ✅ Check YAML files |
| 66 | + language: system |
| 67 | + types: [yaml] |
| 68 | + entry: poetry run check-yaml |
24 | 69 | - id: codespell |
25 | | - args: |
26 | | - - --skip="./.*,*.json" |
27 | | - - --quiet-level=4 |
28 | | - - -L ba,celcius,hass |
29 | | - exclude_types: [json] |
30 | | - - repo: https://github.com/PyCQA/flake8 |
31 | | - rev: 4.0.1 |
32 | | - hooks: |
33 | | - - id: flake8 |
34 | | - additional_dependencies: |
35 | | - - flake8-docstrings==1.5.0 |
36 | | - - pydocstyle==5.0.1 |
37 | | - files: ^pyhilo/.+\.py$ |
38 | | - - repo: https://github.com/pre-commit/mirrors-isort |
39 | | - rev: v4.3.21 |
40 | | - hooks: |
41 | | - - id: isort |
42 | | - additional_dependencies: |
43 | | - - toml |
44 | | - files: ^(pyhilo|tests)/.+\.py$ |
45 | | - - repo: https://github.com/pre-commit/mirrors-mypy |
46 | | - rev: v0.920 |
47 | | - hooks: |
| 70 | + name: ✅ Check code for common misspellings |
| 71 | + language: system |
| 72 | + types: [text] |
| 73 | + exclude: ^poetry\.lock$ |
| 74 | + entry: poetry run codespell |
| 75 | + - id: detect-private-key |
| 76 | + name: 🕵️ Detect Private Keys |
| 77 | + language: system |
| 78 | + types: [text] |
| 79 | + entry: poetry run detect-private-key |
| 80 | + - id: end-of-file-fixer |
| 81 | + name: ⮐ Fix End of Files |
| 82 | + language: system |
| 83 | + types: [text] |
| 84 | + entry: poetry run end-of-file-fixer |
| 85 | + stages: [pre-commit, pre-push, manual] |
48 | 86 | - id: mypy |
49 | | - files: ^pyhilo/.+\.py$ |
50 | | - additional_dependencies: |
51 | | - - types-python-dateutil==2.8.0 |
52 | | - - types-aiofiles==23.2.0 |
53 | | - |
54 | | - - repo: https://github.com/pre-commit/pre-commit-hooks |
55 | | - rev: v5.0.0 |
56 | | - hooks: |
57 | | - - id: check-json |
| 87 | + name: 🆎 Static type checking using mypy |
| 88 | + language: system |
| 89 | + types: [python] |
| 90 | + entry: poetry run mypy |
| 91 | + require_serial: true |
58 | 92 | - id: no-commit-to-branch |
| 93 | + name: 🛑 Don't commit to main branch |
| 94 | + language: system |
| 95 | + entry: poetry run no-commit-to-branch |
| 96 | + pass_filenames: false |
| 97 | + always_run: true |
59 | 98 | args: |
60 | | - - --branch=dev |
61 | 99 | - --branch=main |
62 | | -# - repo: https://github.com/PyCQA/pydocstyle |
63 | | -# rev: 5.0.2 |
64 | | -# hooks: |
65 | | -# - id: pydocstyle |
66 | | -# files: ^((pyhilo|tests)/.+)?[^/]+\.py$ |
67 | | - - repo: https://github.com/gruntwork-io/pre-commit |
68 | | - rev: v0.1.12 |
69 | | - hooks: |
70 | | - - id: shellcheck |
71 | | - files: ^script/.+ |
| 100 | + - id: poetry |
| 101 | + name: 📜 Check pyproject with Poetry |
| 102 | + language: system |
| 103 | + entry: poetry check |
| 104 | + pass_filenames: false |
| 105 | + always_run: true |
| 106 | + - id: prettier |
| 107 | + name: 💄 Ensuring files are prettier |
| 108 | + language: system |
| 109 | + types: [yaml, json, markdown] |
| 110 | + entry: npm run prettier |
| 111 | + pass_filenames: false |
| 112 | + - id: pylint |
| 113 | + name: 🌟 Starring code with pylint |
| 114 | + language: system |
| 115 | + types: [python] |
| 116 | + entry: poetry run pylint |
| 117 | + - id: pytest |
| 118 | + name: 🧪 Running tests and test coverage with pytest |
| 119 | + language: system |
| 120 | + types: [python] |
| 121 | + entry: poetry run pytest |
| 122 | + pass_filenames: false |
| 123 | + - id: trailing-whitespace |
| 124 | + name: ✄ Trim Trailing Whitespace |
| 125 | + language: system |
| 126 | + types: [text] |
| 127 | + entry: poetry run trailing-whitespace-fixer |
| 128 | + stages: [pre-commit, pre-push, manual] |
| 129 | + - id: yamllint |
| 130 | + name: 🎗 Check YAML files with yamllint |
| 131 | + language: system |
| 132 | + types: [yaml] |
| 133 | + entry: poetry run yamllint |
0 commit comments