Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
66 lines (61 loc) · 2.33 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
66 lines (61 loc) · 2.33 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
# Managed by ergon init. Add repository settings to .ergon/local/.pre-commit-config.yaml and run ergon init sync.
#
# Install the hooks with: pre-commit install
default_install_hook_types: [pre-commit, commit-msg, pre-push]
default_stages: [pre-commit]
repos:
# File hygiene, without a language toolchain, at the release of the section common of
# .ergon.yaml, before each commit. pre-commit-hooks declares three of these hooks for the stage
# pre-push as well, so this configuration limits each of them to the stage pre-commit. The hooks
# that change or refuse the content of a file skip the paths of common.hooks.exclude of
# .ergon.yaml. trailing-whitespace also skips the Markdown files, in which two trailing spaces
# break a line.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude_types: [markdown]
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-merge-conflict
- id: detect-private-key
- id: check-added-large-files
args: ["--maxkb=500"]
stages: [pre-commit]
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: check-json
- id: check-toml
- id: check-symlinks
- repo: local
hooks:
# Each commit runs the targets of the Makefile that common.hooks.pre-commit of .ergon.yaml
# lists.
- id: lint
name: make lint
entry: make lint
language: system
pass_filenames: false
- id: test
name: make test
entry: make test
language: system
pass_filenames: false
# Each push runs the targets of the Makefile that common.hooks.pre-push of .ergon.yaml lists.
- id: check
name: make check
entry: make check
language: system
pass_filenames: false
stages: [pre-push]
# The commit message, against .commitlint.yaml. The command of the key ergon of the section
# common of .ergon.yaml installs the commitlint of the section, and checks its archive against
# the digest of the section.
- id: commitlint
name: commitlint
entry: ergon tool run common.commitlint -- lint --message
language: system
stages: [commit-msg]