blob: a552a44fb58899ea28287bf2cc2b356e5786c4db [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# http://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.
---
default_stages: [pre-commit]
default_language_version:
python: python3
minimum_pre_commit_version: '3.2.0'
exclude: ^(.*/.*_vendor/|docs|.venv)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: Add license for all Python files
exclude: ^\.github/.*$|docs
files: \.py$|\.pyi$
args:
- --comment-style
- "|#|"
- --license-filepath
- scripts/ci/LICENSE-template.txt
- --fuzzy-match-generates-todo
- repo: local
hooks:
- id: ruff
name: Ruff Linter
entry: ruff check --fix
language: system
types: [python]
exclude: "tests|docs"
- id: ruff-format
name: Ruff Formatter
entry: ruff format --force-exclude
language: system
types: [python]
- id: mypy
name: Mypy Type Check
entry: mypy
language: system
require_serial: true
types: [python]
exclude: "tests|docs" # see https://github.com/pre-commit/pre-commit/issues/2967
args:
- --config-file=pyproject.toml
- --scripts-are-modules