-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
63 lines (61 loc) · 2.13 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
63 lines (61 loc) · 2.13 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
default_install_hook_types: [pre-commit, commit-msg, post-commit]
# Without this, a hook that does not name its stages runs at every installed
# stage, so the file checks below would repeat on commit-msg and post-commit.
default_stages: [pre-commit]
minimum_pre_commit_version: '3.2.0'
repos:
- repo: local
hooks:
- id: nm-clang-format
name: clang-format (CI version, container)
entry: ./contrib/scripts/nm-code-format-container.sh -i
language: script
files: \.[ch]$
require_serial: true
exclude: |
(?x)^(
src/c-list/|
src/c-rbtree/|
src/c-siphash/|
src/c-stdaux/|
src/libnm-std-aux/unaligned(-fundamental)?\.h|
src/libnm-systemd-core/src/|
src/libnm-systemd-shared/src/|
src/linux-headers/|
src/n-acd/|
src/n-dhcp4/
)
- id: nm-black
name: python black formatting
entry: ./contrib/scripts/nm-python-black-format.sh --check
language: script
types_or: [python]
require_serial: true
- id: nm-potfiles
name: POTFILES.in consistency
entry: src/tests/check-potfile-list.py
language: script
pass_filenames: false
always_run: true
# msgfmt concatenates several input files into one catalog, so the files
# have to be passed one at a time.
- id: nm-po-msgfmt
name: po file validity
entry: bash -c 'for f; do msgfmt --check --output-file=/dev/null "$f"; done' --
language: system
files: ^po/.*\.po$
- id: nm-commit-message
name: commit message rules
entry: ./contrib/scripts/check-commit-message.sh
language: script
stages: [commit-msg]
# Runs after the commit, because checkpatch works on a commit and not on
# the staged files.
- id: nm-checkpatch
name: checkpatch.pl (enforced by CI)
entry: ./contrib/scripts/checkpatch-git-post-commit-hook
language: script
stages: [post-commit]
pass_filenames: false
always_run: true
verbose: true