|
| 1 | +# The generic Techmo's pre-commit hooks configuration — Python 3.8 variant. |
| 2 | +# |
| 3 | +# Used automatically by install.sh when the runtime Python is 3.8. |
| 4 | +# Differences from .pre-commit-config.yaml: |
| 5 | +# - mirrors-mypy pinned to v1.14.0 (last release supporting Python 3.8; |
| 6 | +# mypy 1.15.0 raised Requires-Python to >=3.9) |
| 7 | +# - ruff gets --target-version py38 so UP rules don't suggest py39+ syntax |
| 8 | +# |
| 9 | +# See https://pre-commit.com for more information. |
| 10 | +# See https://pre-commit.com/hooks.html for more hooks. |
| 11 | + |
| 12 | +fail_fast: false |
| 13 | +repos: |
| 14 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 15 | + rev: v5.0.0 |
| 16 | + hooks: |
| 17 | + - id: check-added-large-files |
| 18 | + - id: check-case-conflict |
| 19 | + - id: check-executables-have-shebangs |
| 20 | + - id: check-illegal-windows-names |
| 21 | + - id: check-json |
| 22 | + - id: check-merge-conflict |
| 23 | + - id: check-shebang-scripts-are-executable |
| 24 | + - id: check-symlinks |
| 25 | + - id: check-toml |
| 26 | + - id: check-yaml |
| 27 | + - id: debug-statements |
| 28 | + - id: detect-private-key |
| 29 | + - id: end-of-file-fixer |
| 30 | + exclude: \.patch$ |
| 31 | + - id: fix-byte-order-marker |
| 32 | + - id: mixed-line-ending |
| 33 | + - id: no-commit-to-branch |
| 34 | + args: [--branch, master] |
| 35 | + - id: requirements-txt-fixer |
| 36 | + - id: trailing-whitespace |
| 37 | + exclude: \.patch$ |
| 38 | + args: |
| 39 | + - --markdown-linebreak-ext=md |
| 40 | + |
| 41 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 42 | + rev: v0.15.1 |
| 43 | + hooks: |
| 44 | + - id: ruff-check |
| 45 | + args: [--fix, --select, "E,W,F,I,S,UP,B", --extend-ignore, "S101,S603,S607", --line-length, "160", --target-version, "py38"] |
| 46 | + - id: ruff-format |
| 47 | + args: [--line-length, "160", --target-version, "py38"] |
| 48 | + |
| 49 | + - repo: https://github.com/gitleaks/gitleaks |
| 50 | + rev: v8.30.0 |
| 51 | + hooks: |
| 52 | + - id: gitleaks |
| 53 | + |
| 54 | + - repo: https://github.com/codespell-project/codespell |
| 55 | + rev: v2.4.1 |
| 56 | + hooks: |
| 57 | + - id: codespell |
| 58 | + |
| 59 | + - repo: https://github.com/pre-commit/mirrors-mypy |
| 60 | + rev: v1.14.0 |
| 61 | + hooks: |
| 62 | + - id: mypy |
| 63 | + args: |
| 64 | + [ |
| 65 | + --strict, |
| 66 | + --ignore-missing-imports, |
| 67 | + --check-untyped-defs, |
| 68 | + --show-error-codes, |
| 69 | + ] |
| 70 | + |
| 71 | + - repo: https://github.com/pocc/pre-commit-hooks |
| 72 | + rev: v1.3.5 |
| 73 | + hooks: |
| 74 | + - id: clang-format |
| 75 | + additional_dependencies: [clang-format] |
| 76 | + args: |
| 77 | + - --style=file |
| 78 | + - --fallback-style=none |
| 79 | + - id: cppcheck |
| 80 | + additional_dependencies: [cppcheck] |
| 81 | + args: |
| 82 | + - --std=c++17 |
| 83 | + - --language=c++ |
| 84 | + - --enable=all |
| 85 | + - --error-exitcode=1 |
| 86 | + - --inline-suppr |
| 87 | + - --suppress=missingInclude |
| 88 | + - --suppress=missingIncludeSystem |
| 89 | + - --suppress=unusedFunction |
| 90 | + - --suppress=unmatchedSuppression |
| 91 | + |
| 92 | + - repo: https://github.com/AleksaC/hadolint-py |
| 93 | + rev: v2.14.0 |
| 94 | + hooks: |
| 95 | + - id: hadolint |
| 96 | + args: |
| 97 | + - --ignore=DL3005 # apt-get upgrade is sometimes necessary in base-image builds |
| 98 | + |
| 99 | + - repo: https://github.com/shellcheck-py/shellcheck-py |
| 100 | + rev: v0.11.0.1 |
| 101 | + hooks: |
| 102 | + - id: shellcheck |
| 103 | + |
| 104 | + - repo: https://github.com/maxwinterstein/shfmt-py |
| 105 | + rev: v3.12.0.1 |
| 106 | + hooks: |
| 107 | + - id: shfmt |
| 108 | + name: shfmt |
| 109 | + entry: shfmt |
| 110 | + language: python |
| 111 | + args: |
| 112 | + - -l # list files whose formatting differs from shfmt's |
| 113 | + - -d # error with a diff when the formatting differs |
| 114 | + - -i # indentation |
| 115 | + - "4" # 4 spaces |
| 116 | + - -ci # switch cases will be indented |
| 117 | + - -fn # function opening braces are placed on a separate line |
| 118 | + - -bn # binary ops like && and | may start a line |
| 119 | + - -sr # redirect operators will be followed by a space |
| 120 | + - -s # simplify the code |
| 121 | + - -w # write result to file instead of stdout |
| 122 | + types: [shell] |
| 123 | + require_serial: true |
| 124 | + exclude_types: [bats] |
0 commit comments