forked from ComputationalRadiationPhysics/picongpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
92 lines (92 loc) · 3.36 KB
/
.pre-commit-config.yaml
File metadata and controls
92 lines (92 loc) · 3.36 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
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
minimum_pre_commit_version: 3.2.0 # necessitated by Lucas-C's hooks
default_install_hook_types: [pre-commit, pre-push]
exclude: "thirdParty"
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
hooks:
- id: clang-format
types_or: [file]
files: \.(cpp|def|h|cu|tpp|kernel|loader|unitless|hpp|param)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: no-commit-to-branch
args: [-b, dev]
- id: check-merge-conflict
- id: trailing-whitespace
exclude_types: [markdown, rst]
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: mixed-line-ending
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
exclude: \.tpl$
- id: pretty-format-json
args:
- "--autofix"
- "--no-ensure-ascii"
- "--no-sort-keys"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-tabs
types_or: [file]
exclude_types: [rst, tex, tsv]
- id: remove-tabs
types_or: [file]
exclude_types: [rst, tex, tsv]
- id: forbid-crlf
- id: remove-crlf
- repo: local
hooks:
- id: check_cpp_code_style
name: check_cpp_code_style
entry: share/ci/check_cpp_code_style.sh
language: system
files: \.(cpp|def|h|cu|tpp|kernel|loader|unitless|hpp|param)$
pass_filenames: false
# This hook runs on all files which is why it feels a bit too heavy-weight
# for running before every commit. The CI currently runs manually, so it's
# still running there and can be run manually and pre-push on demand.
# TODO: Adjust the script to take filenames, so that we can pass the
# filenames and speed things up before commits.
stages: [manual, pre-push]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.12.10
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
# Rule E721 is about using isinstance()
# but lib/python/picongpu/pypicongpu/rendering/renderer.py
# is strict about types. Could be solved locally but I think this is fine.
args: [--fix, --ignore, E721]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
args: ["--line-length", "120"]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: require-ascii
# Reasons for exclusion:
# - rst files: This is documentation.
# - CHANGELOG.md: Contains author names that might include special characters for correct spelling.
# - .zenodo.json: Contains author names that might include special characters for correct spelling.
# - unit_dimension.py: Contains theta as the symbol for temperature.
exclude_types: [rst]
exclude: CHANGELOG.md|.zenodo.json|lib/python/picongpu/picmi/diagnostics/unit_dimension.py
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.22.1
hooks:
- id: gersemi
args: [-c, --diff, --no-warn-about-unknown-commands]
- id: gersemi
args: [-i, --no-warn-about-unknown-commands]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt