|
| 1 | +# Skip execution of one or more hooks using the SKIP environment variable: |
| 2 | +# $ SKIP=pylint git commit -m "foo" |
| 3 | +# $ SKIP=mypy,pylint pre-commit run --all-files |
| 4 | +# |
| 5 | +# If want to disable all hooks while committing, use the --no-verify/-n option: |
| 6 | +# $ git commit -n -m "foo" |
| 7 | + |
| 8 | +repos: |
| 9 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 10 | + rev: v4.4.0 |
| 11 | + hooks: |
| 12 | + - id: trailing-whitespace |
| 13 | + - id: end-of-file-fixer |
| 14 | + - id: mixed-line-ending |
| 15 | + - id: check-case-conflict |
| 16 | + - id: check-yaml |
| 17 | + - id: check-merge-conflict |
| 18 | + - id: check-vcs-permalinks |
| 19 | + - id: detect-private-key |
| 20 | + - id: debug-statements |
| 21 | + - id: check-docstring-first |
| 22 | + - id: check-toml |
| 23 | + - repo: https://github.com/DavidAnson/markdownlint-cli2 |
| 24 | + rev: v0.8.1 |
| 25 | + hooks: |
| 26 | + - id: markdownlint-cli2-fix |
| 27 | + name: markdownlint-cli2-fix (in place fixes) |
| 28 | + - repo: https://github.com/leoll2/copyright_notice_precommit |
| 29 | + rev: 0.1.1 |
| 30 | + hooks: |
| 31 | + - id: copyright-notice |
| 32 | + args: [--notice=COPYRIGHT] |
| 33 | + files: python |
| 34 | + - repo: https://github.com/asottile/pyupgrade |
| 35 | + rev: v3.10.1 |
| 36 | + hooks: |
| 37 | + - id: pyupgrade |
| 38 | + args: [--py38-plus] |
| 39 | + # exclude: *fixtures |
| 40 | + - repo: https://github.com/PyCQA/autoflake |
| 41 | + rev: v2.2.1 |
| 42 | + hooks: |
| 43 | + - id: autoflake |
| 44 | + args: |
| 45 | + - --in-place |
| 46 | + - --expand-star-imports |
| 47 | + - --remove-all-unused-imports |
| 48 | + - --ignore-init-module-imports |
| 49 | + - --remove-duplicate-keys |
| 50 | + - --remove-unused-variables |
| 51 | + - --remove-rhs-for-unused-variables |
| 52 | + - repo: https://github.com/PyCQA/isort |
| 53 | + rev: 5.12.0 |
| 54 | + hooks: |
| 55 | + - id: isort |
| 56 | + name: isort (black profile, in place fixes) |
| 57 | + args: ["--profile", "black", "--filter-files"] |
| 58 | + - repo: https://github.com/DanielNoord/pydocstringformatter |
| 59 | + rev: v0.7.3 |
| 60 | + hooks: |
| 61 | + - id: pydocstringformatter |
| 62 | + - repo: https://github.com/asottile/yesqa |
| 63 | + rev: v1.5.0 |
| 64 | + hooks: |
| 65 | + - id: yesqa |
| 66 | + - repo: https://github.com/psf/black |
| 67 | + rev: 23.9.1 |
| 68 | + hooks: |
| 69 | + - id: black |
| 70 | + name: black (in place fixes) |
| 71 | + # args: [--diff, --check] |
| 72 | + # It is recommended to specify the latest version of Python |
| 73 | + # supported by your project here, or alternatively use |
| 74 | + # pre-commit's default_language_version, see |
| 75 | + # https://pre-commit.com/#top_level-default_language_version |
| 76 | + # language_version: python3.11 |
| 77 | + - repo: https://github.com/PyCQA/flake8 |
| 78 | + rev: 6.1.0 |
| 79 | + hooks: |
| 80 | + - id: flake8 |
| 81 | + additional_dependencies: [Flake8-pyproject] |
| 82 | + - repo: https://github.com/PyCQA/bandit |
| 83 | + rev: 1.7.5 |
| 84 | + hooks: |
| 85 | + - id: bandit |
| 86 | + name: bandit (checksig) |
| 87 | + exclude: ".*test.*" |
| 88 | + language: python |
| 89 | + types: [python] |
| 90 | + - repo: https://github.com/PyCQA/bandit |
| 91 | + rev: 1.7.5 |
| 92 | + hooks: |
| 93 | + - id: bandit |
| 94 | + name: bandit (tests) |
| 95 | + # for the test folder disable |
| 96 | + # B101, Test for use of assert |
| 97 | + args: ["--skip", "B101,B311"] |
| 98 | + exclude: checksig |
| 99 | + language: python |
| 100 | + types: [python] |
| 101 | + - repo: https://github.com/pre-commit/mirrors-mypy |
| 102 | + rev: v1.5.1 |
| 103 | + hooks: |
| 104 | + - id: mypy |
0 commit comments