# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.15.12 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: local hooks: # Ensure SKILL.md files adhere to mdformat standards for optimal markdown # consumption by agents without degraded structure. - id: mdformat name: mdformat entry: uv run mdformat language: system files: SKILL\.md$ # Run pytest only on modified test files. - id: pytest name: pytest entry: pytest language: system files: ^tests/.*test_.*\.py$ # Block third-party brand / company names in added diff lines. # Implemented via a Gemini call in scripts/check_brands.py — only # the allowed-brand list lives in the script (Google + first-party # products + Cymbal as the fictitious-brand placeholder). Requires # `gcloud auth application-default login` + a resolvable GCP # project. Set BRAND_CHECK_SKIP=1 to bypass deliberately. - id: brand-check-code name: brand-check (added diff lines, via Gemini) entry: python3 scripts/check_brands.py --code-files language: system types: [python] # Same check, applied to the in-flight commit message. Runs in the # commit-msg stage so contributors must install that stage explicitly: # pre-commit install --hook-type commit-msg - id: brand-check-msg name: brand-check (commit message, via Gemini) entry: python3 scripts/check_brands.py --commit-msg language: system stages: [commit-msg]