From b232b16e0266b2d6bd8a35b7dae036adb5f6dbec Mon Sep 17 00:00:00 2001 From: runner Date: Fri, 19 Jun 2026 00:32:09 +0000 Subject: [PATCH] update pre-commit-config --- .pre-commit-config.yaml | 180 +++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 94 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0909b1eb..acb349d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,96 +1,88 @@ -# Pre-commit hooks for automated formatting and linting -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks - repos: - # C++ formatting with clang-format - - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v22.1.5 - hooks: - - id: clang-format - files: \.(cpp|hpp|c|h)$ - exclude: ^(3rdparty/|build.*/|install/) - args: [--style=file] - - # CMake formatting - - repo: https://github.com/cheshirekow/cmake-format-precommit - rev: v0.6.13 - hooks: - - id: cmake-format - files: \.(cmake|CMakeLists\.txt)$ - exclude: ^(3rdparty/|build.*/|install/) - - # Python import sorting - - repo: https://github.com/pycqa/isort - rev: 9.0.0a3 - hooks: - - id: isort - args: [--settings-path, setup.cfg] - - # Ruff Python linter - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.15.16 - hooks: - - id: ruff - args: [--fix] - - id: ruff-format - - # Flake8 Python style/lint checker (supplemental to Ruff) - - repo: https://github.com/pycqa/flake8 - rev: 7.3.0 - hooks: - - id: flake8 - - # YAML linting - - repo: https://github.com/adrienverge/yamllint.git - rev: v1.38.0 - hooks: - - id: yamllint - - # EditorConfig compliance - - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: 3.6.1 - hooks: - - id: editorconfig-checker - exclude: ^(3rdparty/|build.*/|install/) - args: [--disable-indent-size] - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: check-added-large-files - args: [--maxkb=1024, --enforce-all] - - id: check-json - files: \.json$ - exclude: ^(3rdparty/|build.*/|install/) - - id: pretty-format-json - files: \.json$ - exclude: ^(3rdparty/|build.*/|install/) - args: [--autofix, --indent=2, --no-ensure-ascii] - - id: check-yaml - files: \.(yaml|yml)$ - exclude: ^(3rdparty/|build.*/|install/) - - id: check-case-conflict - exclude: ^(3rdparty/|build.*/|install/) - - id: check-merge-conflict - exclude: ^(3rdparty/|build.*/|install/) - - # Dockerfile linting with hadolint - - repo: https://github.com/hadolint/hadolint - rev: v2.14.0 - hooks: - - id: hadolint-docker - types: [file] - files: (^|/)(Dockerfile|.*\.Dockerfile)$ - args: [--config, .hadolint.yaml] - - - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.22.1 - hooks: - - id: markdownlint-cli2 - exclude: ^(3rdparty/|build.*/|install/) - args: ["--fix"] - -# Configuration -default_stages: [pre-commit] +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v22.1.5 + hooks: + - id: clang-format + files: \.(cpp|hpp|c|h)$ + exclude: ^(3rdparty/|build.*/|install/) + args: + - --style=file +- repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + files: \.(cmake|CMakeLists\.txt)$ + exclude: ^(3rdparty/|build.*/|install/) +- repo: https://github.com/pycqa/isort + rev: 8.0.1 + hooks: + - id: isort + args: + - --settings-path + - setup.cfg +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.15.18 + hooks: + - id: ruff + args: + - --fix + - id: ruff-format +- repo: https://github.com/pycqa/flake8 + rev: 7.3.0 + hooks: + - id: flake8 +- repo: https://github.com/adrienverge/yamllint.git + rev: v1.38.0 + hooks: + - id: yamllint +- repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: 3.6.1 + hooks: + - id: editorconfig-checker + exclude: ^(3rdparty/|build.*/|install/) + args: + - --disable-indent-size +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-added-large-files + args: + - --maxkb=1024 + - --enforce-all + - id: check-json + files: \.json$ + exclude: ^(3rdparty/|build.*/|install/) + - id: pretty-format-json + files: \.json$ + exclude: ^(3rdparty/|build.*/|install/) + args: + - --autofix + - --indent=2 + - --no-ensure-ascii + - id: check-yaml + files: \.(yaml|yml)$ + exclude: ^(3rdparty/|build.*/|install/) + - id: check-case-conflict + exclude: ^(3rdparty/|build.*/|install/) + - id: check-merge-conflict + exclude: ^(3rdparty/|build.*/|install/) +- repo: https://github.com/hadolint/hadolint + rev: v2.14.0 + hooks: + - id: hadolint-docker + types: + - file + files: (^|/)(Dockerfile|.*\.Dockerfile)$ + args: + - --config + - .hadolint.yaml +- repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.22.1 + hooks: + - id: markdownlint-cli2 + exclude: ^(3rdparty/|build.*/|install/) + args: + - --fix +default_stages: +- pre-commit fail_fast: false