-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
96 lines (87 loc) · 3.46 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
96 lines (87 loc) · 3.46 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
---
default_language_version:
node: system
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # 5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: 192ad822316c3a22fb3d3cc8aa6eafa0b8488360 # 0.45.0
hooks:
- id: markdownlint
- repo: https://github.com/koalaman/shellcheck-precommit
rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # 0.10.0
hooks:
- id: shellcheck
# -x follows `source`d files. The integration-test scripts share
# lib.sh, and without it every one of them reports SC1091 for a file
# that is right there and checkable.
args: ["--severity=info", "-x"]
- repo: local
hooks:
# The packaging files are in `files:` because tests in src/lib.rs
# `include_str!` them: the Windows dialog is checked against the
# connection-string parser, and sbom-native.json's SQLite version against
# the library that is actually linked. Changing one of those without
# touching any .rs file is exactly the case those tests exist to catch,
# and without this the hook would not run for it.
- id: cargo-test
name: cargo-test
language: system
entry: cargo test --locked
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$|Cargo\.(toml|lock)|^packaging/(sbom-native\.json|windows/(configure-dsn\.ps1|install\.bat))$
- id: cargo-rustfmt
name: cargo-rustfmt
language: system
entry: cargo fmt --all -- --check
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$
- id: cargo-clippy
name: cargo-clippy
language: system
entry: cargo clippy --locked --all-targets -- -D warnings
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$
# Broken intra-doc links are warnings, not errors, so they reach a
# published doc build silently. -D warnings promotes them. Runs in well
# under a second because the dependency graph is already built above.
#
# --document-private-items, because almost everything in this crate is
# private -- `backend::setup` entirely so -- and without it their doc
# comments are checked by nothing. Not `--all-targets`: that builds the
# test target, sets `cfg(test)`, and would pull the `#[cfg(test)]`
# modules into the check.
- id: cargo-doc
name: cargo-doc
language: system
entry: env RUSTDOCFLAGS=-Dwarnings cargo doc --locked --no-deps --document-private-items
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$|Cargo\.(toml|lock)
- id: cargo-sort
name: cargo-sort
language: system
entry: cargo sort --grouped --check
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: Cargo\.toml$
- id: cargo-deny
name: cargo-deny
language: system
entry: cargo deny --locked check
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: Cargo\.(toml|lock)|deny\.toml