# Copyright (c) 2020-now by the Zeek Project. See LICENSE for details. # # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: local hooks: - id: checkbashisms name: Check for bashisms in /bin/sh scripts entry: ./tests/Scripts/3rdparty/checkbashisms.pl language: script types: ["sh"] stages: ["pre-commit"] - id: license name: Check for license headers entry: ./tests/Scripts/license-header.py language: python stages: ["pre-commit"] types: [text] exclude: '^tests|NOTES|README|autogen|^(CHANGES|VERSION|scripts/ninja-build-stats|\.gitmodules|\.paths|.*\.(decl|json|rst|t2d|txt))$' - id: autogen-docs name: Check that generated documentation is up-to-date entry: ./doc/scripts/autogen-docs language: script pass_filenames: false stages: ["pre-commit"] - id: stray-baselines name: Check for stray BTest baselines entry: ./tests/Scripts/stray_baselines.py additional_dependencies: - btest language: python pass_filenames: false stages: ["pre-commit"] - repo: https://github.com/pre-commit/mirrors-clang-format rev: 'v20.1.0' hooks: - id: clang-format types_or: ["c", "c++"] stages: ["pre-commit"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: trailing-whitespace exclude: '^tests/Baseline' - id: end-of-file-fixer exclude: '^tests/Baseline|^doc/autogen|^doc/_static' - id: check-yaml stages: ["pre-commit"] - id: check-added-large-files - repo: https://gitlab.com/daverona/pre-commit/cpp rev: 0.8.0 hooks: - id: cpplint exclude: '3rdparty/' args: ["--quiet"] stages: ["pre-commit"] - repo: https://github.com/jorisroovers/gitlint rev: v0.19.1 hooks: - id: gitlint - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: - id: rst-backticks stages: ["pre-commit"] - id: rst-directive-colons stages: ["pre-commit"] - id: rst-inline-touching-normal stages: ["pre-commit"] - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: - id: cmake-format stages: ["pre-commit"] - id: cmake-lint stages: ["pre-commit"] - repo: https://github.com/crate-ci/typos rev: v1.31.1 hooks: - id: typos exclude: 'tests/.*/regexp/.*|.clang-tidy' - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.11.5 hooks: - id: ruff args: [ --fix ] - id: ruff-format exclude: 3rdparty/|doc/(autogen|.*examples)/|/Baseline/|(\.svg$)|(\.dat$)