Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
59 lines (54 loc) · 2.42 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
59 lines (54 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Install both the pre-commit and commit-msg stage hooks on a plain
# `pre-commit install` (no --hook-type flags needed).
default_install_hook_types: [pre-commit, commit-msg]
# Files copied verbatim from the oold-schema repository at a release tag: the vendored
# meta-schemas (whose sha256 is recorded in meta/index.json) and the OO-LD test fixtures.
# Reformatting them would break those checksums and make every future refresh from upstream
# produce a spurious diff, so the whitespace/JSON-formatting hooks must leave them alone.
# `check-json` still runs on them - it validates without rewriting.
x-vendored: &vendored >-
^(src/oold/validation/meta/[0-9]|tests/data/oold/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v6.0.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
exclude: ^.devcontainer/devcontainer.json
- id: pretty-format-json
exclude: ^(\.devcontainer/devcontainer\.json|src/oold/validation/meta/[0-9]|tests/data/oold/)
args: [--autofix, --no-sort-keys]
- id: end-of-file-fixer
exclude: *vendored
- id: trailing-whitespace
exclude: *vendored
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.7"
hooks:
- id: ruff-check
args: [--exit-non-zero-on-fix]
- id: ruff-format
# Enforce Conventional Commits locally so python-semantic-release can derive
# versions and the changelog. Runs on the commit-msg stage; install it with
# `pre-commit install --hook-type commit-msg` (done by `make install`).
- repo: https://github.com/compilerla/conventional-pre-commit
rev: "v4.0.0"
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# Declaring any markdown_extensions in zensical.toml replaces Zensical's defaults
# instead of extending them, so dropping one switches an extension off with no
# warning and no build failure. See scripts/check_markdown_extensions.py.
- repo: local
hooks:
- id: markdown-extensions
name: check zensical.toml restates Zensical's default Markdown extensions
# Goes through make so the invocation matches `make check` and CI exactly.
entry: make check-extensions
language: system
pass_filenames: false
files: ^(zensical\.toml|scripts/check_markdown_extensions\.py|Makefile)$
require_serial: true