-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
102 lines (91 loc) · 3.53 KB
/
.pre-commit-config.yaml
File metadata and controls
102 lines (91 loc) · 3.53 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
93
94
95
96
97
98
99
100
101
102
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
ci:
autofix_commit_msg: |
[pre-commit.ci] auto code formatting
autofix_prs: false
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: quarterly
submodules: false
# Please update the rev: SHAs below with this command:
# pre-commit autoupdate --freeze
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: c60c980e561ed3e73101667fe8365c609d19a438 # frozen: v0.15.9
hooks:
- id: ruff-check
args: [--fix, --show-fixes]
exclude: ^cuda_bindings/cuda/bindings/_internal/_fast_enum\.py$
- id: ruff-format
- repo: local
hooks:
- id: check-spdx
name: Check SPDX Headers
entry: python ./toolshed/check_spdx.py
language: python
additional_dependencies:
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)|(.*\.patch$)'
args: ["--fix"]
- id: no-markdown-in-docs-source
name: Prevent markdown files in docs/source directories
entry: bash -c
args:
- 'for file in "$@"; do >&2 echo "error: markdown file "$file" found in a docs/source directory. Only reST (.rst) is allowed"; done && exit 1'
- "_" # fake script name, because bash considers $0 (the first argument) to be the script name
language: system
files: '^.*/docs/source/.*\.md$'
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0
hooks:
- id: check-added-large-files
exclude: cuda_bindings/cuda/bindings/nvml.pyx
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: &gen_exclude '^(?:cuda_python/README\.md|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?)$'
- id: mixed-line-ending
- id: trailing-whitespace
exclude: |
(?x)^(?:
cuda_python/README\.md|
cuda_bindings/cuda/bindings/.*\.in?|
cuda_bindings/docs/source/module/.*\.rst?|
.*\.patch$
)$
# Checking for common mistakes
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316" # frozen: v1.10.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 8e5c80792e2ec0c87804d8ef915bf35e2caea6da # frozen: v1.20.0
hooks:
- id: mypy
name: mypy-pathfinder
files: ^cuda_pathfinder/cuda/.*\.py$ # Exclude tests directory
args: [--config-file=cuda_pathfinder/pyproject.toml]
- repo: https://github.com/rhysd/actionlint
rev: "914e7df21a07ef503a81201c76d2b11c789d3fca" # frozen: v1.7.12
hooks:
- id: actionlint
args: ["-shellcheck="]
exclude: ^\.github/workflows/coverage.yml$
- repo: https://github.com/MarcoGorelli/cython-lint
rev: "7c6152f6c8f9087684ff2e09a9227941e233bafb" # frozen: v0.19.0
hooks:
- id: cython-lint
args: [--no-pycodestyle]
exclude: ^cuda_bindings/
default_language_version:
python: python3