Files
cyborg/.pre-commit-config.yaml
T
Sean Mooney 3f9aa074b4 pci-sim: Add local validation tooling
The pci-sim module is developed out of tree, but it needs to keep
following kernel coding conventions as it grows. Developers currently have
to know which kernel tools to run and which warnings are expected for this
module.

Add local validation support for pci-sim. This includes a kernel
clang-format baseline, a vendored checkpatch copy with a pci-sim-specific
--no-spelling option, and lint and build-test Makefile targets. Spelling
remains owned by the repository pre-commit codespell hook.

Normalize the existing pci-sim C sources with the kernel clang-format
configuration and clean up the current checkpatch baseline where practical.
The remaining ignored checkpatch types are limited to clang-format line
wrapping, the isolated out-of-tree compatibility header, and the Makefile
path list used by the lint target.

Document the expected developer workflow so future pci-sim changes can be
checked consistently.

Assisted-By: pi gpt-5.5
Change-Id: Ic4183133157000bf5bc32e08cc78cc7e3377a648
Signed-off-by: Sean Mooney <work@seanmooney.info>
2026-07-09 12:33:32 +01:00

60 lines
1.6 KiB
YAML

---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# whitespace
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: '.*\.(svg)$'
- id: fix-byte-order-marker
# file format and permissions
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-yaml
files: .*\.(yaml|yml)$
- id: check-json
files: .*\.json$
- id: check-ast
# git
- id: check-added-large-files
- id: check-case-conflict
- id: detect-private-key
- id: check-merge-conflict
exclude: '.*\.(rst|inc)$'
# python
- id: debug-statements
- id: check-docstring-first
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.1
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://opendev.org/openstack/hacking
rev: 8.0.0
hooks:
- id: hacking
additional_dependencies: []
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: ['--ignore-words=doc/dictionary.txt']
exclude: ^pci-sim/tools/checkpatch\.pl$
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0
hooks:
- id: sphinx-lint
args: [--enable=default-role]
files: ^doc/|^releasenotes/|^api-guide/
types: [rst]
- repo: https://github.com/PyCQA/doc8
rev: v1.1.2
hooks:
- id: doc8