Files
openRuyi/.pre-commit-config.yaml

62 lines
2.0 KiB
YAML

# SPDX-FileCopyrightText: (C) 2025, 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
# SPDX-FileCopyrightText: (C) 2025, 2026 openRuyi Project Contributors
# SPDX-FileContributor: yyjeqhc <jialin.oerv@isrc.iscas.ac.cn>
# SPDX-FileContributor: Zheng Junjie <zhengjunjie@iscas.ac.cn>
# SPDX-FileContributor: lzyprime <2383518170@qq.com>
#
# SPDX-License-Identifier: MulanPSL-2.0
repos:
- repo: local
hooks:
- id: no-group-tag
name: "check no Group tag"
language: pygrep
entry: '^Group:'
files: \.spec$
- id: autorelease
name: "check autorelease macro"
language: pygrep
entry: '^Release:.*(%autorelease|%{autorelease}).*$'
args: ["--negate"]
files: \.spec$
- id: autochangelog
name: "check autochangelog macro"
language: pygrep
entry: '%changelog\s+%autochangelog'
args: ["--negate", "--multiline"]
files: \.spec$
- id: format-spacing
name: "Check format spacing"
language: pygrep
entry: '^(((BuildOption\(.*\)|BuildRequires):(?! {2}))|(%files {2,}(?=\S)))'
args: []
files: \.spec$
- id: sourcewithRemoteAsset
name: "check Source with #!RemoteAsset"
language: python
entry: scripts/pre-commit-hooks/check_source_with_remoteasset.py
files: \.spec$
pass_filenames: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
files: \.spec$
- id: end-of-file-fixer
files: \.spec$
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- repo: local
hooks:
- id: reuse-add-annotate
name: "Add REUSE license headers"
language: python
entry: scripts/pre-commit-hooks/reuse-add-annotate.py
files: \.spec$
pass_filenames: true
additional_dependencies: ['reuse>=6.0.0']