qusal/.pre-commit-config.yaml
2024-07-08 17:08:12 +02:00

103 lines
3.1 KiB
YAML

# yamllint disable-line rule:line-length
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
repos:
- repo: local
hooks:
- id: unicode-prohibit
name: unicode-prohibit
entry: scripts/unicode-prohibit.sh
language: script
pass_filenames: true
description: Prohibit Unicode
- id: spell-lint
name: spell-lint
entry: scripts/spell-lint.sh
language: script
pass_filenames: true
description: Spellcheck files
- id: shell-lint
name: shell-lint
entry: scripts/shell-lint.sh
language: script
pass_filenames: true
# yamllint disable rule:line-length
files: (\.sh|/rc\.local\.d/.*\.rc|/bin/.*|/rpc/.*|/network-hooks\.d/.*|/qubes-firewall\.d/.*|/(lib-)?qubes-bind-dirs\.d/.*|/\.config/(sh|bash|zsh|less|x11|git/shell|git/template/hooks)/.*|/autostart-scripts/.*|/qvm-copy-dotfiles|/git-core/.*)
# yamllint disable rule:line-length
exclude: \.(policy|asc|txt|top|sls|jinja|toml|vim|py|muttrc|nft|md|spec|list|sources|repo|socket|timer|service|y(a)?ml)$
description: Lint Shellscripts
- id: markdown-lint
name: markdown-lint
entry: scripts/markdown-lint.sh
language: script
pass_filenames: true
files: \.md$
description: Lint Markdown files
- id: python-lint
name: python-lint
entry: scripts/python-lint.sh
language: script
pass_filenames: true
files: \.py$
description: Lint Python files
- id: salt-lint
name: salt-lint
entry: scripts/salt-lint.sh
language: script
pass_filenames: true
files: (^minion.d/.*.conf|\.(sls|top))$
description: Lint Salt files
- id: yaml-lint
name: yaml-lint
entry: scripts/yaml-lint.sh
language: script
pass_filenames: true
files: \.(yaml|yml)$
description: Lint YAML files
- id: qubesbuilder-gen
name: qubesbuilder-gen
entry: scripts/qubesbuilder-gen.sh
args: [test]
language: script
pass_filenames: false
files: salt/\S+/README.md
description: Check if .qubesbuilder is up to date
- id: spec-gen
name: spec-gen
language: script
entry: scripts/spec-gen.sh
args: [test]
pass_filenames: true
# yamllint disable rule:line-length
files: ^(rpm_spec/template/template.spec|salt/.*|scripts/spec-(get|gen)\.sh)$
description: Check if RPM SPEC files are up to date
- id: license-lint
name: license-lint
entry: reuse
args: [lint]
language: python
pass_filenames: false
description: Lint files to comply with the REUSE Specification
- id: commit-lint
name: commit-lint
language: python
entry: gitlint
args: [--staged, --msg-filename]
stages: [commit-msg]
pass_filenames: true
description: Lint Git commits