|
| 1 | +# To use: |
| 2 | +# |
| 3 | +# pre-commit run -a |
| 4 | +# |
| 5 | +# Or: |
| 6 | +# |
| 7 | +# pre-commit install # (runs every time you commit in git) |
| 8 | +# |
| 9 | +# To update this file: |
| 10 | +# |
| 11 | +# pre-commit autoupdate |
| 12 | +# |
| 13 | +# See https://github.com/pre-commit/pre-commit |
| 14 | + |
| 15 | +repos: |
| 16 | + # Standard hooks |
| 17 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 18 | + rev: v5.0.0 |
| 19 | + hooks: |
| 20 | + - id: check-added-large-files |
| 21 | + - id: check-ast |
| 22 | + - id: check-case-conflict |
| 23 | + - id: check-docstring-first |
| 24 | + - id: check-merge-conflict |
| 25 | + - id: check-symlinks |
| 26 | + - id: check-xml |
| 27 | + - id: check-yaml |
| 28 | + - id: debug-statements |
| 29 | + - id: end-of-file-fixer |
| 30 | + exclude: (\.(svg|stl|dae))$ |
| 31 | + - id: mixed-line-ending |
| 32 | + - id: trailing-whitespace |
| 33 | + - id: fix-byte-order-marker |
| 34 | + |
| 35 | + # markdownlint hook |
| 36 | + - repo: https://github.com/igorshubovych/markdownlint-cli |
| 37 | + rev: v0.42.0 |
| 38 | + hooks: |
| 39 | + - id: markdownlint |
| 40 | + # Disable max line length check for markdown |
| 41 | + args: ["--disable", "~MD013"] |
| 42 | + |
| 43 | + # shellcheck hook |
| 44 | + - repo: https://github.com/koalaman/shellcheck-precommit |
| 45 | + rev: v0.10.0 |
| 46 | + hooks: |
| 47 | + - id: shellcheck |
| 48 | + |
| 49 | + # Python hooks |
| 50 | + - repo: https://github.com/asottile/pyupgrade |
| 51 | + rev: v3.17.0 |
| 52 | + hooks: |
| 53 | + - id: pyupgrade |
| 54 | + args: [--py36-plus] |
| 55 | + |
| 56 | + - repo: https://github.com/psf/black |
| 57 | + rev: 24.10.0 |
| 58 | + hooks: |
| 59 | + - id: black |
| 60 | + args: ["--line-length=120"] |
| 61 | + |
| 62 | + - repo: https://github.com/pycqa/flake8 |
| 63 | + rev: 7.1.1 |
| 64 | + hooks: |
| 65 | + - id: flake8 |
| 66 | + args: ['--max-line-length=120'] |
| 67 | + |
| 68 | + # CPP hooks |
| 69 | + - repo: https://github.com/pre-commit/mirrors-clang-format |
| 70 | + rev: v19.1.1 |
| 71 | + hooks: |
| 72 | + - id: clang-format |
| 73 | + files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|proto|vert)$ |
| 74 | + |
| 75 | + # TODO: Add ament checks for ROS packages, if required |
| 76 | + |
| 77 | + # Spellcheck in comments and docs |
| 78 | + - repo: https://github.com/codespell-project/codespell |
| 79 | + rev: v2.3.0 |
| 80 | + hooks: |
| 81 | + - id: codespell |
| 82 | + exclude: \.(svg|stl|dae)$ |
0 commit comments