# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks # This file defines what runs automatically before `git commit` repos: # ============================================================ # 1. Official pre-commit hooks (safety & hygiene) # # These hooks are: # - extremely fast # - non-controversial # - designed to prevent costly mistakes # ============================================================ - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: # Prevent committing unresolved merge conflicts - id: check-merge-conflict # Remove trailing whitespace - id: trailing-whitespace # Ensure files end with a newline (POSIX requirement) - id: end-of-file-fixer # Prevent accidentally committing large files # (model checkpoints, logs, datasets, etc.) - id: check-added-large-files args: - "--maxkb=10240" # Attempts to load all yaml files to verify syntax. - id: check-yaml # 排除 detectron2 使用了 pyyaml 语法的 yaml 文件 exclude: | (?x)( ^common/base/autodrive/3rdparty/detectron2/configs/Base-RetinaNet\.yaml$ | ^common/base/autodrive/3rdparty/detectron2/projects/Panoptic-DeepLab/configs/COCO-PanopticSegmentation/panoptic_deeplab_R_52_os16_mg124_poly_200k_bs64_crop_640_640_coco_dsconv\.yaml$ ) # Attempts to load all json files to verify syntax. - id: check-json # Attempts to load all TOML files to verify syntax. - id: check-toml # Checks for symlinks which do not point to anything. - id: check-symlinks