gm-assistant/.pre-commit-config.yaml

70 lines
2.0 KiB
YAML

# SPDX-FileCopyrightText: 2025 2025
# SPDX-FileContributor: Gergely Polonkai
#
# SPDX-License-Identifier: GPL-3.0-or-later
repos:
- repo: local
hooks:
- id: commitizen
name: commitizen check
stages: ["commit-msg"]
language: system
entry: poetry run cz
args: ["check", "--allow-abort", "--commit-msg-file"]
- id: commitizen-branch
name: commitizen check branch
stages: [pre-push]
language: system
always_run: true
entry: poetry run cz
args: ["check", "--rev-range", "origin/HEAD..HEAD"]
pass_filenames: false
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
stages: ["pre-commit"]
language: system
entry: poetry run black
args: ["--check", "--diff"]
require_serial: true
types_or: [python, pyi]
- id: isort
name: isort
stages: ["pre-commit"]
language: system
entry: poetry run isort
args: ["--check", "--diff"]
require_serial: true
types_or: [python, pyi]
- id: pylint
name: pylint
stages: ["pre-commit"]
language: system
entry: poetry run pylint
require_serial: true
types_or: [python, pyi]
- id: mypy
name: mypy
stages: ["pre-commit"]
language: system
entry: poetry run mypy
args: ["--strict"]
require_serial: true
types_or: [python, pyi]
- id: reuse
name: reuse
description: "REUSE compliance check for modified files"
stages: ["pre-commit"]
language: system
entry: poetry run reuse
args: ["lint-file", "--lines"]
- id: reuse-all
name: reuse-all
description: "REUSE compliance check for the complete project"
stages: ["pre-push"]
language: system
entry: poetry run reuse
args: ["lint", "--lines"]
pass_filenames: false