2022-05-19 03:38:00 -03:00
|
|
|
# See https://pre-commit.com for more information, specially https://pre-commit.com/#pre-commit-run for manual trigger
|
|
|
|
# Some example useful invocations:
|
|
|
|
# pre-commit run: this is what pre-commit runs by default when committing. This will run all hooks against currently staged files.
|
|
|
|
# pre-commit run --all-files: run all the hooks against all the files. This is a useful invocation if you are using pre-commit in CI.
|
|
|
|
# pre-commit run check-executables-have-shebangs: run the check-executables-have-shebangs hook against all staged files.
|
|
|
|
|
|
|
|
# Files or directory we want to excude from checking
|
|
|
|
exclude: |
|
|
|
|
(?x)(
|
|
|
|
^modules/ |
|
|
|
|
^build/ |
|
|
|
|
^cmake-build-debug/ |
|
|
|
|
\.m |
|
|
|
|
^libraries/AP_HAL_ChibiOS/hwdef/scripts/
|
|
|
|
)
|
|
|
|
|
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-08-21 23:32:31 -03:00
|
|
|
rev: v4.4.0
|
2022-05-19 03:38:00 -03:00
|
|
|
hooks:
|
|
|
|
#- id: trailing-whitespace
|
|
|
|
#- id: end-of-file-fixer
|
|
|
|
- id: mixed-line-ending
|
|
|
|
name: Check line ending character (LF)
|
|
|
|
args: ["--fix=lf"]
|
|
|
|
types_or: [python, c, c++, shell]
|
|
|
|
- id: check-added-large-files
|
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-shebang-scripts-are-executable
|
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
.*\/wscript |
|
|
|
|
wscript
|
|
|
|
)$
|
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: check-xml
|
|
|
|
- id: check-yaml
|
|
|
|
|
2023-03-22 03:10:54 -03:00
|
|
|
- repo: https://github.com/lsst-ts/pre-commit-xmllint
|
2023-08-21 23:32:31 -03:00
|
|
|
rev: 6f36260b537bf9a42b6ea5262c915ae50786296e
|
2023-03-22 03:10:54 -03:00
|
|
|
hooks:
|
|
|
|
- id: format-xmllint
|
|
|
|
files: libraries/AP_DDS/dds_xrce_profile.xml
|
2023-03-12 23:03:13 -03:00
|
|
|
- repo: https://github.com/psf/black
|
2023-08-21 23:32:31 -03:00
|
|
|
rev: 23.7.0
|
2023-03-12 23:03:13 -03:00
|
|
|
hooks:
|
|
|
|
- id: black
|
|
|
|
files: libraries\/AP_DDS\/(wscript|.*\.py)$
|
|
|
|
|
2023-03-12 12:48:14 -03:00
|
|
|
# # Use to sort python imports by name and put system import first.
|
|
|
|
# - repo: https://github.com/pycqa/isort
|
2023-03-11 01:05:35 -04:00
|
|
|
# rev: 5.12.0
|
2023-03-12 12:48:14 -03:00
|
|
|
# hooks:
|
|
|
|
# - id: isort
|
|
|
|
# args: [--check-only]
|
|
|
|
# name: isort (python)
|
2022-05-19 03:38:00 -03:00
|
|
|
|
2023-03-12 12:48:14 -03:00
|
|
|
# # Use to check python typing to show errors.
|
|
|
|
# - repo: https://github.com/pre-commit/mirrors-mypy
|
|
|
|
# rev: 'v0.950'
|
|
|
|
# hooks:
|
|
|
|
# - id: mypy
|
|
|
|
# args: [--no-strict-optional, --ignore-missing-imports]
|
|
|
|
# additional_dependencies: [types-PyYAML, types-requests]
|