-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
115 lines (113 loc) · 3.7 KB
/
.pre-commit-config.yaml
File metadata and controls
115 lines (113 loc) · 3.7 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
exclude: '(.*\.snap|.*render-link.html|head.hbs)'
- id: check-yaml
- id: mixed-line-ending
- id: trailing-whitespace
# rustfmt handles rust files, and in some snapshots we expect trailing spaces.
exclude: '.*\.(rs|snap)$'
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
# https://github.com/crate-ci/typos/issues/347
pass_filenames: false
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.1
hooks:
- id: prettier
additional_dependencies:
- prettier
# TODO: This doesn't seem to work, would be great to fix.
# https://github.com/PRQL/prql/issues/3078
- prettier-plugin-go-template
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.0
hooks:
- id: clang-format
types_or: [c, c++]
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: fmt
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: clippy
stages: [manual]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.11
hooks:
- id: actionlint
# Link checker using local hooks with language: rust
# Pre-commit will automatically install lychee via cargo
- repo: local
hooks:
- id: lychee
name: lychee (local links only)
entry: lychee
language: rust
additional_dependencies: ["cli:lychee:0.20.1"]
files: \.(md|rst)$
exclude: ^web/website/themes/
args:
- --no-progress
# For PRs: whitelist PRQL domains and local files only
# Pattern matches:
# - github.com/PRQL/* and github.com/prql/*
# - prql-lang.org/*
# - raw.githubusercontent.com/PRQL/* and raw.githubusercontent.com/prql/*
# - file://* (local/relative links)
# All other external links are skipped for faster PR checks
- --include=^(https://(github\.com/(PRQL|prql)|prql-lang\.org|raw\.githubusercontent\.com/(PRQL|prql))|file://)
- id: lychee-all
name: lychee-all (all links)
entry: lychee
language: rust
additional_dependencies: ["cli:lychee:0.20.1"]
stages: [manual]
files: \.(md|rst)$
exclude: ^web/website/themes/
args: ["--config=.config/lychee.toml", "--no-progress"]
- repo: local
hooks:
- id: no-dbg
name: no-dbg
description: We shouldn't merge code with `dbg!` in
language: pygrep
types: ["rust"]
entry: "dbg!"
- repo: local
hooks:
- id: prql-codeblock
name: Prevent prql codeblocks evaluating in book
description:
prql code blocks are evaluated and replaced in the book; instead use
`prql no-eval`
language: pygrep
entry: "```prql$"
files: 'CHANGELOG\.md$'
# This is quite strict, and doesn't fix a large enough share of the issues it
# finds, so we don't include it. But it's reasonable to run every now & again
# manually and take its fixes.
#
# - repo: https://github.com/DavidAnson/markdownlint-cli2
# rev: v0.5.1
# hooks:
# - id: markdownlint-cli2
# args: ["--fix"]
# additional_dependencies:
# - markdown-it-footnote
ci:
# Currently network access isn't supported in the CI product.
skip: [fmt, lychee, lychee-all]
autoupdate_commit_msg: "chore: pre-commit autoupdate"