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
# Hooks published for other repositories to consume:
#
# repos:
# - repo: https://github.com/slb350/drep
# rev: v2.0.0
# hooks:
# - id: drep-check-push
#
# `language: rust` so pre-commit builds the binary from this repository
# (`cargo install --path .`) into its own environment. With `language: system`
# the consumer has to install drep themselves first and the hook simply fails
# if they have not; `language: python` was the 1.x answer and installs a PyPI
# package that 2.0 does not publish.
#
# types_or covers every language the registry knows: with `types: [python]`
# these hooks never fired in a Go or TypeScript repo.
- id: drep-check
name: drep code quality check
description: Check staged files (deterministic tools always; LLM if configured)
entry: drep check --staged
language: rust
pass_filenames: false
types_or:
- id: drep-check-push
name: drep code quality check (pre-push)
description: Check the files an outgoing push touches
entry: drep check --push-gate
language: rust
# Filenames come from pre-commit, which at the pre-push stage resolves them
# to what the outgoing commits touch. `--staged` would be wrong here: nothing
# is staged at push time, so it would analyze nothing and pass silently.
stages:
types_or:
- id: drep-check-all
name: drep full check
description: Check every supported file in the repository
entry: drep check
language: rust
pass_filenames: false
types_or:
# `--fail-on error`, not `--strict`. Severity here answers one question: does
# the finding change how the document renders? An unclosed fence does - the
# rest of the file becomes code - and it is the only check that says `error`.
# `--strict` is `--fail-on info`, which blocks on trailing whitespace and line
# length: 75 findings on drep's own tree, none of them above `info`. A hook
# that blocks a commit over a long line is a hook the consumer deletes.
- id: drep-lint-docs
name: drep markdown lint
description: Rule-based markdown checks on staged docs (no LLM, no config)
entry: drep lint-docs --fail-on error
language: rust
types: