forked from xnvme/xnvme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
92 lines (85 loc) · 2.35 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
---
exclude: ^(subprojects|toolbox\/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$
# REUSE-software compliance check
- repo: https://github.com/fsfe/reuse-tool
rev: v1.1.2
hooks:
- id: reuse
# Yaml: intended for the GitHUB Actions .yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.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.2.3
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: '23.3.0'
hooks:
- id: black
name: Python-format-black
- repo: https://github.com/pycqa/isort
rev: '5.12.0'
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: '6.0.0'
hooks:
- id: flake8
name: Python-lint-flake8
args:
- --extend-ignore=E203,F401,F811,E501
exclude: (ctypes_mapping\/api\.py)$
# Rust tools
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
name: Rust-fmt-xnvme
args: ['--verbose', '--manifest-path', 'rust/xnvme/Cargo.toml', '--']
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
name: Rust-fmt-xnvme-sys
args: ['--verbose', '--manifest-path', 'rust/xnvme-sys/Cargo.toml', '--']