forked from xnvme/xnvme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
96 lines (89 loc) · 2.48 KB
/
.pre-commit-config.yaml
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
---
exclude: ^(subprojects|third-party)/
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
# C source format; minor difference between .c / .h, much different style for the fio io-engine.
# For the details, then compare: toolbox/clang-format-*
- repo: local
hooks:
- id: clang-format
name: C-format-headers
language: system
entry: toolbox/pcf_clang_format.py
args: ["--style-file", "toolbox/clang-format-h"]
files: \.h$
- id: clang-format
name: C-format-source
language: system
entry: toolbox/pcf_clang_format.py
args: ["--style-file", "toolbox/clang-format-c"]
files: \.c$
exclude: xnvme_fioe.c$
- id: clang-format
name: C-format-fioe
language: system
entry: toolbox/pcf_clang_format.py
args: ["--style-file", "toolbox/clang-format-fioe"]
files: xnvme_fioe\.c$
# Git: intended for commit-message formating
#- repo: local
# hooks:
# - id: commit-msg-check
# name: Git-Validate commit message
# language: pygrep
# entry: '\A(?![A-Za-z]+: .+\nSigned-off-by:.+)'
# args: [--multiline]
# stages: [commit-msg]
# Yaml: intended for the GitHUB Actions .yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-yaml # pre-commit-hook-yamlfmt only works on valid YAML files
name: YAML-format-check
types: [file]
files: \.(yaml|yml|config|workflow)$
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.1
hooks:
- id: yamlfmt
name: YAML-format
args:
- '--mapping=2'
- '--sequence=2'
- '--offset=0'
- '--width=120'
- '--preserve-quotes'
types: [file]
files: \.(yaml|yml|config|workflow)$
# Python: for all the helpers in toolbox/*
- repo: https://github.com/psf/black
rev: '22.3.0'
hooks:
- id: black
name: Python-format-black
- repo: https://github.com/pycqa/isort
rev: '5.10.1'
hooks:
# Available args: https://pycqa.github.io/isort/docs/configuration/options.html
- id: isort
name: Python-format-isort
args:
- '--profile=black'
- '--line-length=88'
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
hooks:
- id: flake8
name: Python-lint-flake8
args:
- --extend-ignore=E203,F401,F811,E501
exclude: (ctypes_mapping\/api\.py)$
# Shell: todo: exclude xnvme-driver.sh
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.6
hooks:
- id: shellcheck
name: Shell-lint
exclude: (xnvme-driver\.sh)|(pkgs.*\.sh)$