|
| 1 | +# Apply to all files without commiting: |
| 2 | +# pre-commit run --all-files |
| 3 | +# Update this file: |
| 4 | +# pre-commit autoupdate |
| 5 | +exclude: ^(.*/versioneer\.py|.*/_version\.py|.*/.*\.svg) |
| 6 | + |
| 7 | +ci: |
| 8 | + autofix_commit_msg: | |
| 9 | + [pre-commit.ci] auto fixes from pre-commit.com hooks |
| 10 | +
|
| 11 | + for more information, see https://pre-commit.ci |
| 12 | + autofix_prs: true |
| 13 | + autoupdate_branch: '' |
| 14 | + autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' |
| 15 | + autoupdate_schedule: weekly |
| 16 | + skip: [] |
| 17 | + submodules: false |
| 18 | + |
| 19 | +repos: |
| 20 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 21 | + rev: v4.6.0 |
| 22 | + hooks: |
| 23 | + - id: check-ast |
| 24 | + - id: check-builtin-literals |
| 25 | + - id: fix-byte-order-marker |
| 26 | + - id: check-case-conflict |
| 27 | + - id: check-docstring-first |
| 28 | + - id: check-vcs-permalinks |
| 29 | + # Fail if staged files are above a certain size. |
| 30 | + # To add a large file, use 'git lfs track <file>; git add <file> to track large files with |
| 31 | + # git-lfs rather than commiting them directly to the git history |
| 32 | + - id: check-added-large-files |
| 33 | + args: [ "--maxkb=500" ] |
| 34 | + - id: fix-byte-order-marker |
| 35 | + - id: check-case-conflict |
| 36 | + # Fails if there are any ">>>>>" lines in files due to merge conflicts. |
| 37 | + - id: check-merge-conflict |
| 38 | + # ensure syntaxes are valid |
| 39 | + - id: check-toml |
| 40 | + - id: debug-statements |
| 41 | + - id: detect-private-key |
| 42 | + # Makes sure files end in a newline and only a newline; |
| 43 | + - id: end-of-file-fixer |
| 44 | + - id: mixed-line-ending |
| 45 | + # Trims trailing whitespace. Allow a single space on the end of .md lines for hard line breaks. |
| 46 | + - id: trailing-whitespace |
| 47 | + args: [ --markdown-linebreak-ext=md ] |
| 48 | + # Sort requirements in requirements.txt files. |
| 49 | + - id: requirements-txt-fixer |
| 50 | + # Prevent committing directly to trunk |
| 51 | + - id: no-commit-to-branch |
| 52 | + args: [ "--branch=master" ] |
| 53 | + # Detects the presence of private keys |
| 54 | + - id: detect-private-key |
| 55 | + |
| 56 | + - repo: https://github.com/jorisroovers/gitlint |
| 57 | + rev: v0.19.1 |
| 58 | + hooks: |
| 59 | + - id: gitlint |
| 60 | + |
| 61 | + - repo: https://github.com/codespell-project/codespell |
| 62 | + rev: v2.3.0 |
| 63 | + hooks: |
| 64 | + - id: codespell |
| 65 | + args: [--write] |
| 66 | + |
| 67 | + - repo: https://github.com/python-jsonschema/check-jsonschema |
| 68 | + rev: 0.29.2 |
| 69 | + hooks: |
| 70 | + - id: check-github-workflows |
| 71 | + |
| 72 | + - repo: https://github.com/akaihola/darker |
| 73 | + rev: v2.1.1 |
| 74 | + hooks: |
| 75 | + - id: darker |
| 76 | + |
| 77 | + - repo: https://github.com/PyCQA/autoflake |
| 78 | + rev: v2.3.1 |
| 79 | + hooks: |
| 80 | + - id: autoflake |
| 81 | + args: |
| 82 | + - --in-place |
| 83 | + - --remove-all-unused-imports |
| 84 | + - --remove-unused-variable |
| 85 | + - --ignore-init-module-imports |
| 86 | + |
| 87 | + - repo: https://github.com/pre-commit/mirrors-autopep8 |
| 88 | + rev: v2.0.4 |
| 89 | + hooks: |
| 90 | + - id: autopep8 |
| 91 | + exclude: ^docs/ |
| 92 | + |
| 93 | +# - repo: https://github.com/pycqa/flake8 |
| 94 | +# rev: 7.1.1 |
| 95 | +# hooks: |
| 96 | +# - id: flake8 |
| 97 | +# additional_dependencies: |
| 98 | +# - radon |
| 99 | +# - flake8-docstrings |
| 100 | +# - Flake8-pyproject |
| 101 | +# exclude: ^docs/ |
| 102 | + |
| 103 | + |
| 104 | + - repo: https://github.com/PyCQA/pylint |
| 105 | + rev: v3.3.1 |
| 106 | + hooks: |
| 107 | + - id: pylint |
| 108 | + args: |
| 109 | + - --exit-zero |
| 110 | + |
| 111 | +# - repo: https://github.com/google/yapf |
| 112 | +# rev: v0.31.0 |
| 113 | +# hooks: |
| 114 | +# - id: yapf |
| 115 | +# name: "yapf" |
| 116 | +# additional_dependencies: [toml] |
| 117 | + |
| 118 | +# - repo: https://github.com/RobertCraigie/pyright-python |
| 119 | +# rev: v1.1.383 |
| 120 | +# hooks: |
| 121 | +# - id: pyright |
| 122 | + |
| 123 | +# - repo: https://github.com/adrienverge/yamllint.git |
| 124 | +# rev: v1.29.0 |
| 125 | +# hooks: |
| 126 | +# - id: yamllint |
| 127 | +# args: [--strict] |
| 128 | + |
| 129 | +# - repo: https://github.com/mattseymour/pre-commit-pytype |
| 130 | +# rev: '2020.10.8' |
| 131 | +# hooks: |
| 132 | +# - id: pytype |
| 133 | + |
| 134 | + - repo: https://github.com/asottile/pyupgrade |
| 135 | + rev: v3.17.0 |
| 136 | + hooks: |
| 137 | + - id: pyupgrade |
| 138 | + args: [--py38-plus, --keep-runtime-typing] |
| 139 | + |
| 140 | + - repo: https://github.com/charliermarsh/ruff-pre-commit |
| 141 | + # Ruff version. |
| 142 | + rev: v0.6.8 |
| 143 | + hooks: |
| 144 | + # Run the linter. |
| 145 | + - id: ruff |
| 146 | + args: [--fix, --exit-non-zero-on-fix] |
| 147 | + # Run the formatter. |
| 148 | + - id: ruff-format |
| 149 | + |
| 150 | + - repo: https://github.com/dosisod/refurb |
| 151 | + rev: v2.0.0 |
| 152 | + hooks: |
| 153 | + - id: refurb |
| 154 | + |
| 155 | +# - repo: https://github.com/pre-commit/mirrors-mypy |
| 156 | +# rev: v1.11.2 |
| 157 | +# hooks: |
| 158 | +# - id: mypy |
| 159 | +# args: |
| 160 | +# [ |
| 161 | +# --config-file=./pyproject.toml, |
| 162 | +# ] |
| 163 | + |
| 164 | +# - repo: https://github.com/executablebooks/mdformat |
| 165 | +# rev: 0.7.17 |
| 166 | +# hooks: |
| 167 | +# - id: mdformat |
| 168 | +# additional_dependencies: |
| 169 | +# # gfm = GitHub Flavored Markdown |
| 170 | +# - mdformat-gfm |
| 171 | +# - mdformat-black |
| 172 | + |
| 173 | +# - repo: https://github.com/PyCQA/bandit |
| 174 | +# rev: 1.7.10 |
| 175 | +# hooks: |
| 176 | +# - id: bandit |
| 177 | +# args: ["-r", "."] |
| 178 | +# # ignore all tests, not just tests data |
| 179 | +# exclude: ^tests/ |
0 commit comments