|
1 | 1 | --- |
| 2 | +ci: |
| 3 | + autofix_commit_msg: "Chore: pre-commit autoupdate" |
| 4 | + skip: |
| 5 | + # pre-commit.ci cannot install WGET, so tomlint must be disabled |
| 6 | + - tomllint |
| 7 | + |
| 8 | +exclude: | |
| 9 | + (?x)^( |
| 10 | + docs\/conf.py| |
| 11 | + dco-signoffs/$ |
| 12 | + )$ |
| 13 | +
|
2 | 14 | repos: |
3 | | - - repo: git://github.com/Lucas-C/pre-commit-hooks |
4 | | - rev: v1.1.10 |
| 15 | + - repo: local |
5 | 16 | hooks: |
6 | | - - id: remove-tabs |
| 17 | + - id: tomllint |
| 18 | + name: "Script: scripts/tomllint.sh" |
| 19 | + language: script |
| 20 | + # pass_filenames: false |
| 21 | + files: \^*.toml |
| 22 | + types: [file] |
| 23 | + entry: scripts/tomllint.sh . |
7 | 24 |
|
8 | | - - repo: git://github.com/pre-commit/pre-commit-hooks |
9 | | - rev: v4.0.1 |
| 25 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 26 | + rev: v4.6.0 |
10 | 27 | hooks: |
11 | | - - id: trailing-whitespace |
12 | | - - id: check-merge-conflict |
13 | | - - id: end-of-file-fixer |
14 | | - - id: name-tests-test |
15 | | - - id: check-byte-order-marker |
| 28 | + - id: check-added-large-files |
| 29 | + - id: check-ast |
16 | 30 | - id: check-case-conflict |
17 | | - - id: check-docstring-first |
| 31 | + - id: check-executables-have-shebangs |
18 | 32 | - id: check-json |
| 33 | + - id: check-merge-conflict |
| 34 | + - id: check-shebang-scripts-are-executable |
19 | 35 | - id: check-symlinks |
20 | | - - id: detect-private-key |
21 | | - - id: check-ast |
| 36 | + - id: check-toml |
| 37 | + # - id: detect-aws-credentials |
| 38 | + - id: check-xml |
| 39 | + - id: check-yaml |
22 | 40 | - id: debug-statements |
| 41 | + - id: detect-private-key |
| 42 | + - id: end-of-file-fixer |
| 43 | + - id: mixed-line-ending |
| 44 | + args: ["--fix=lf"] |
| 45 | + - id: name-tests-test |
| 46 | + args: ["--pytest-test-first"] |
| 47 | + - id: no-commit-to-branch |
| 48 | + # - id: pretty-format-json |
| 49 | + - id: requirements-txt-fixer |
| 50 | + - id: trailing-whitespace |
| 51 | + |
| 52 | + - repo: https://github.com/pre-commit/mirrors-prettier |
| 53 | + rev: v4.0.0-alpha.8 |
| 54 | + hooks: |
| 55 | + - id: prettier |
| 56 | + args: ["--no-error-on-unmatched-pattern", "--ignore-unknown"] |
| 57 | + |
| 58 | + - repo: https://github.com/igorshubovych/markdownlint-cli |
| 59 | + rev: v0.41.0 |
| 60 | + hooks: |
| 61 | + - id: markdownlint |
| 62 | + args: ["--fix"] |
| 63 | + |
| 64 | + - repo: https://github.com/jorisroovers/gitlint |
| 65 | + rev: v0.19.1 |
| 66 | + hooks: |
| 67 | + - id: gitlint |
| 68 | + |
| 69 | + - repo: https://github.com/openstack/bashate |
| 70 | + rev: 2.1.1 |
| 71 | + hooks: |
| 72 | + - id: bashate |
| 73 | + args: ["--ignore=E006,E011"] |
23 | 74 |
|
24 | | - - repo: git://github.com/pycqa/pydocstyle.git |
25 | | - rev: 6.1.1 |
| 75 | + - repo: https://github.com/shellcheck-py/shellcheck-py |
| 76 | + rev: v0.10.0.1 |
| 77 | + hooks: |
| 78 | + - id: shellcheck |
| 79 | + |
| 80 | + - repo: https://github.com/pycqa/pydocstyle.git |
| 81 | + rev: 6.3.0 |
26 | 82 | hooks: |
27 | 83 | - id: pydocstyle |
| 84 | + additional_dependencies: ["tomli"] |
28 | 85 |
|
29 | | - - repo: https://github.com/pre-commit/pre-commit-hooks |
30 | | - rev: v4.0.1 |
| 86 | + - repo: https://github.com/Mateusz-Grzelinski/actionlint-py |
| 87 | + rev: v1.7.1.15 |
31 | 88 | hooks: |
32 | | - - id: check-toml |
33 | | - - id: check-yaml |
34 | | - - id: end-of-file-fixer |
35 | | - - id: trailing-whitespace |
| 89 | + - id: actionlint |
36 | 90 |
|
37 | | - - repo: https://github.com/pre-commit/mirrors-mypy |
38 | | - rev: v0.902 |
| 91 | + - repo: https://github.com/pycqa/flake8 |
| 92 | + rev: "7.1.0" |
39 | 93 | hooks: |
40 | | - - id: mypy |
41 | | - exclude: '^(docs|tasks|tests)|setup\.py' |
42 | | - args: [--ignore-missing-imports] |
| 94 | + - id: flake8 |
| 95 | + additional_dependencies: |
| 96 | + - pep8-naming |
43 | 97 |
|
44 | | - - repo: https://github.com/psf/black |
45 | | - rev: 21.6b0 |
| 98 | + - repo: https://github.com/adrienverge/yamllint.git |
| 99 | + rev: v1.35.1 |
46 | 100 | hooks: |
47 | | - - id: black |
| 101 | + - id: yamllint |
| 102 | + args: |
| 103 | + [ |
| 104 | + "-d", |
| 105 | + "{rules: {line-length: {max: 120}}, ignore-from-file: [.gitignore],}", |
| 106 | + ] |
48 | 107 |
|
49 | | - - repo: https://github.com/tomcatling/black-nb |
50 | | - rev: '0.5.0' |
| 108 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 109 | + rev: v0.4.9 |
51 | 110 | hooks: |
52 | | - - id: black-nb |
| 111 | + - id: ruff |
| 112 | + files: ^(scripts|tests|custom_components)/.+\.py$ |
| 113 | + args: [--fix, --exit-non-zero-on-fix] |
| 114 | + - id: ruff-format |
| 115 | + files: ^(scripts|tests|custom_components)/.+\.py$ |
53 | 116 |
|
54 | | - # Enable this in repositories with python packages. |
55 | | - # - repo: https://github.com/mgedmin/check-manifest |
56 | | - # rev: '0.39' |
57 | | - # hooks: |
58 | | - # - id: check-manifest |
| 117 | + - repo: local |
| 118 | + hooks: |
| 119 | + - id: mypy-cache |
| 120 | + name: "create mypy cache" |
| 121 | + language: system |
| 122 | + pass_filenames: false |
| 123 | + entry: bash -c 'if [ ! -d .mypy_cache ]; then /bin/mkdir .mypy_cache; fi; exit 0' |
59 | 124 |
|
60 | | - - repo: https://github.com/s-weigand/flake8-nb |
61 | | - rev: v0.3.0 |
| 125 | + - repo: https://github.com/pre-commit/mirrors-mypy |
| 126 | + rev: "v1.10.0" |
62 | 127 | hooks: |
63 | | - - id: flake8-nb |
64 | | - additional_dependencies: ['pep8-naming'] |
65 | | - # Ignore all format-related checks as Black takes care of those. |
66 | | - args: ['--ignore', 'E2,W5', '--select', 'E,W,F,N', '--max-line-length=120'] |
| 128 | + - id: mypy |
| 129 | + verbose: true |
| 130 | + args: ["--show-error-codes", "--install-types", "--non-interactive"] |
| 131 | + additional_dependencies: ["pytest", "types-requests"] |
| 132 | + |
| 133 | + # Check for misspellings in documentation files |
| 134 | + # - repo: https://github.com/codespell-project/codespell |
| 135 | + # rev: v2.2.2 |
| 136 | + # hooks: |
| 137 | + # - id: codespell |
| 138 | + |
| 139 | + # To embrace black styles, even in docs |
| 140 | + # - repo: https://github.com/asottile/blacken-docs |
| 141 | + # rev: v1.13.0 |
| 142 | + # hooks: |
| 143 | + # - id: blacken-docs |
| 144 | + # additional_dependencies: [black] |
| 145 | + |
| 146 | + # Automatically upgrade Python syntax for newer versions |
| 147 | + # - repo: https://github.com/asottile/pyupgrade |
| 148 | + # rev: v3.15.0 |
| 149 | + # hooks: |
| 150 | + # - id: pyupgrade |
| 151 | + # args: ['--py37-plus'] |
0 commit comments