-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (58 loc) · 2.16 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
60 lines (58 loc) · 2.16 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
# Shared pre-commit configuration, kept as close to identical as possible across every
# f2calv repository - only the repo-specific paths in the top-level `exclude` differ.
#
# Linting is run manually; the `lint` job in CI is the authoritative gate:
# pre-commit run --all-files
# pre-commit autoupdate #refresh the rev: pins below
#
# Note: the per-commit git hook is deliberately NOT installed - its cost is fixed
# interpreter start-up per hook, so a one-file commit pays the same price as a full run.
# `pre-commit install` therefore installs a cheaper once-per-push hook instead.
default_install_hook_types: [pre-push]
# Excluded from EVERY hook. Prefer a per-hook `exclude:` when only one hook is noisy, so
# the file keeps the rest of its checks.
exclude: |
(?x)^(
\.editorconfig|
\.devcontainer/devcontainer\.json|
Directory\.Packages\.props|
src/CasCap\.SmartHaus/Resources/.*|
charts/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
#structural validation
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-toml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-added-large-files
args: [--maxkb=150]
#whitespace hygiene
#Note: line endings are owned by .gitattributes (* text=auto eol=lf), which normalises at
#the git layer. A mixed-line-ending hook only rewrites worktree bytes git already treats as
#identical, so it produces churn on Windows without protecting anything.
- id: end-of-file-fixer
#Note: Visual Studio and VS Code drop the trailing newline when they format JSON on
#save, so these files churn on every edit and break CI. Their content is still
#validated by check-json5 below - only the newline check is waived.
exclude: |
(?x)(
appsettings.*\.json$|
launchSettings\.json$|
^\.vscode/.*\.json$
)
- id: trailing-whitespace
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.1
hooks:
- id: check-json5
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.49.1
hooks:
- id: markdownlint
args: ["--disable", "MD013", "--disable", "MD034", "--"]