forked from NVIDIA/cuopt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
110 lines (107 loc) · 3.54 KB
/
.pre-commit-config.yaml
File metadata and controls
110 lines (107 loc) · 3.54 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
103
104
105
106
107
108
109
110
# SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v6.0.0'
hooks:
- id: end-of-file-fixer
exclude: ^(datasets|helmchart)/.*\.(mps|json|yaml|yml|txt)$
- id: trailing-whitespace
exclude: ^datasets/.*\.(mps|json|yaml|yml|txt)$
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
files: \.(yaml)$
exclude: ^(helmchart)/.*\.(yaml)$
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
# Use the config file specific to each subproject so that each
# project can specify its own first/third-party packages.
args: ["--config-root=python/", "--resolve-all-configs"]
files: ^(python/.*|ci/.*)
types_or: [python, cython, pyi]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
files: ^(python/.*|ci/.*)
# Explicitly specify the pyproject.toml at the repo root, not per-project.
args: ["--config", "pyproject.toml", "--target-version", "py310"]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ["--config=.flake8"]
files: python/.*$
types: [file]
types_or: [python, cython]
additional_dependencies: ["flake8-force"]
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
# https://github.com/PyCQA/pydocstyle/issues/603
additional_dependencies: [toml]
args: ["--config=pyproject.toml"]
exclude: |
(?x)^(
ci|
cpp|
conda|
docs|
notebooks
)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.4
hooks:
- id: clang-format
files: \.(cu|cuh|h|hpp|cpp|inl)$
types_or: [file]
args: ['-fallback-style=none', '-style=file', '-i']
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.20.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean", "--warn-all", "--strict"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["--severity=warning"]
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.7.0
hooks:
- id: verify-copyright
files: |
(?x)
[.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$|
CMakeLists[.]txt$|
recipe[.]yaml$
exclude: |
(?x)^(
^cpp/tests/utilities/cxxopts.hpp
)
- repo: local
hooks:
- id: update-versions
name: Update versions1.json
entry: python ci/utils/update_doc_versions.py
language: system
files: docs/cuopt/source/versions1.json
default_language_version:
python: python3