-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
64 lines (64 loc) · 2.63 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
64 lines (64 loc) · 2.63 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
# MANAGED by EpiAwarePackageTools.scaffold — do not edit by hand.
repos:
#####
# Basic file cleanliness
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
# `templates/` (in a kit that ships scaffold templates) holds files with
# `{{PLACEHOLDER}}` tokens that are not valid YAML/TOML until substituted,
# so exclude that tree from the structural parsers. Absent in a normal
# package, where these excludes are a no-op.
- id: check-yaml
exclude: '^templates/'
- id: check-toml
exclude: '^templates/'
# `--assume-in-merge` so the check runs on every commit, not only while a
# merge is in progress (the default only fires when `.git/MERGE_HEAD`
# exists). Without it the hook is a no-op outside a merge, so a stray
# conflict marker committed after a resolve — or with `--no-verify` — sails
# through; that is how a marker reached CI on #250 (#251).
- id: check-merge-conflict
args: [--assume-in-merge]
- id: check-json
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
#####
# Conflict markers the stock hook misses
# `check-merge-conflict` only looks for `<<<<<<<`, `=======` and `>>>>>>>`. A
# `diff3`/`zdiff3` conflict style also emits a `|||||||` base marker, which it
# does NOT catch — that is the exact marker that reached CI on #250. Forbid it
# explicitly. Seven pipes at the start of a line (`||||||| <ref>`) is the
# marker's shape and does not occur in real code or markdown tables (#251).
- repo: local
hooks:
- id: forbid-diff3-base-marker
name: forbid diff3 conflict base marker
entry: '^\|\|\|\|\|\|\|'
language: pygrep
types: [text]
#####
# Julia
# Due to lack of first-class Julia support, this needs a local Julia install
# with JuliaFormatter.jl available. Keep `rev` in step with the pinned
# JuliaFormatter in the formatter test environment and `.JuliaFormatter.toml`.
- repo: https://github.com/domluna/JuliaFormatter.jl
rev: v2.10.1
hooks:
- id: julia-formatter
# A package that ships scaffold templates (e.g. EpiAwarePackageTools) keeps
# them under `templates/`; some carry `{{PLACEHOLDER}}` tokens that are not
# parseable Julia until substituted, so exclude that tree from formatting.
# The directory is absent in a normal package, where this is a no-op.
exclude: '^templates/'
#####
# Secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: '.*/Manifest\.toml$'