|
| 1 | +--- |
| 2 | +minimum_pre_commit_version: 1.21.0 |
| 3 | +fail_fast: false |
| 4 | +default_stages: [commit, push] |
| 5 | +repos: |
| 6 | + # meta |
| 7 | + |
| 8 | + - repo: meta |
| 9 | + hooks: |
| 10 | + - id: check-hooks-apply |
| 11 | + - id: check-useless-excludes |
| 12 | + |
| 13 | + # formatters |
| 14 | + |
| 15 | + - repo: https://github.com/asottile/reorder_python_imports |
| 16 | + rev: v1.9.0 |
| 17 | + hooks: |
| 18 | + - id: reorder-python-imports |
| 19 | + |
| 20 | + - repo: https://github.com/ambv/black |
| 21 | + rev: 19.10b0 |
| 22 | + hooks: |
| 23 | + - id: black |
| 24 | + |
| 25 | + # - repo: https://github.com/pre-commit/mirrors-yapf |
| 26 | + # rev: v0.28.0 |
| 27 | + # hooks: |
| 28 | + # - id: yapf |
| 29 | + |
| 30 | + - repo: https://github.com/asottile/pyupgrade |
| 31 | + rev: v1.26.0 |
| 32 | + hooks: |
| 33 | + - id: pyupgrade |
| 34 | + stages: [push] |
| 35 | + |
| 36 | + # linters |
| 37 | + |
| 38 | + - repo: https://github.com/PyCQA/bandit |
| 39 | + rev: 1.6.2 |
| 40 | + hooks: |
| 41 | + - id: bandit |
| 42 | + args: ["-x", "tests"] |
| 43 | + stages: [push] |
| 44 | + |
| 45 | + - repo: https://github.com/PyCQA/pydocstyle |
| 46 | + rev: 5.0.2 |
| 47 | + hooks: |
| 48 | + - id: pydocstyle |
| 49 | + args: ["--ignore=D10,D21,D202"] |
| 50 | + |
| 51 | + |
| 52 | + - repo: local |
| 53 | + hooks: |
| 54 | + |
| 55 | + - id: safety |
| 56 | + name: safety |
| 57 | + entry: safety |
| 58 | + language: system |
| 59 | + pass_filenames: false |
| 60 | + args: ["check", "--bare"] |
| 61 | + stages: [push] |
| 62 | + |
| 63 | + - id: poetry |
| 64 | + name: poetry |
| 65 | + description: Validates the structure of the pyproject.toml file |
| 66 | + entry: poetry check |
| 67 | + language: system |
| 68 | + pass_filenames: false |
| 69 | + files: ^pyproject.toml$ |
| 70 | + stages: [push] |
| 71 | + |
| 72 | + - repo: https://github.com/adrienverge/yamllint |
| 73 | + rev: v1.20.0 |
| 74 | + hooks: |
| 75 | + - id: yamllint |
| 76 | + args: ["--strict", "-d", "{rules: {line-length: {max: 180}}}"] |
| 77 | + # |
| 78 | + exclude: > |
| 79 | + (?x)^( |
| 80 | + ^{{.*}}.*\.yaml$| |
| 81 | + ^helm-chart/templates/.*$ |
| 82 | + ) |
| 83 | + # |
| 84 | + |
| 85 | + - repo: https://github.com/pre-commit/mirrors-mypy |
| 86 | + rev: v0.761 |
| 87 | + hooks: |
| 88 | + - id: mypy |
| 89 | + |
| 90 | + - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks |
| 91 | + rev: v0.1.0 |
| 92 | + hooks: |
| 93 | + - id: dockerfilelint |
| 94 | + stages: [commit] # required |
| 95 | + |
| 96 | + # miscellaneous |
| 97 | + |
| 98 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 99 | + rev: v2.4.0 |
| 100 | + hooks: |
| 101 | + - id: check-added-large-files |
| 102 | + - id: check-docstring-first |
| 103 | + - id: debug-statements |
| 104 | + - id: end-of-file-fixer |
| 105 | + - id: flake8 |
| 106 | + additional_dependencies: ["flake8-bugbear"] |
| 107 | + - id: trailing-whitespace |
| 108 | + - id: check-ast |
| 109 | + - id: check-builtin-literals |
| 110 | + - id: detect-private-key |
| 111 | + - id: mixed-line-ending |
| 112 | + - id: name-tests-test |
| 113 | + args: ["--django"] |
| 114 | + |
| 115 | + - repo: https://github.com/pre-commit/pygrep-hooks |
| 116 | + rev: v1.4.4 |
| 117 | + hooks: |
| 118 | + # - id: rst-backticks |
| 119 | + - id: python-use-type-annotations |
| 120 | + - id: python-no-log-warn |
| 121 | + - id: python-no-eval |
| 122 | + - id: python-check-mock-methods |
| 123 | + - id: python-check-blanket-noqa |
| 124 | + |
| 125 | + # commit-msg |
| 126 | + # http://jorisroovers.com/gitlint/#using-gitlint-through-pre-commit |
| 127 | + |
| 128 | + - repo: https://github.com/jorisroovers/gitlint |
| 129 | + rev: v0.12.0 |
| 130 | + hooks: |
| 131 | + - id: gitlint |
0 commit comments