Skip to content

Commit 7948940

Browse files
committed
add ruff to pre-commit-hooks
1 parent 213baf4 commit 7948940

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2024, NVIDIA CORPORATION.
2+
3+
repos:
4+
# - repo: https://github.com/pre-commit/pre-commit-hooks
5+
# rev: v4.6.0
6+
# hooks:
7+
# - id: end-of-file-fixer
8+
# - id: trailing-whitespace
9+
# - id: mixed-line-ending
10+
# args: ['--fix=lf']
11+
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.6.4
14+
hooks:
15+
- id: ruff
16+
args: [--fix]
17+
- id: ruff-format
18+
19+
default_language_version:
20+
python: python3

cuda_core/pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,30 @@ include = ["cuda.core*"]
5555
[tool.setuptools.dynamic]
5656
version = { attr = "cuda.core._version.__version__" }
5757
readme = { file = ["README.md"], content-type = "text/markdown" }
58+
59+
[tool.ruff]
60+
line-length = 120
61+
62+
[tool.ruff.format]
63+
docstring-code-format = true
64+
65+
[tool.ruff.lint]
66+
select = [
67+
# pycodestyle Error
68+
"E",
69+
# Pyflakes
70+
"F",
71+
# pycodestyle Warning
72+
"W",
73+
# pyupgrade
74+
"UP",
75+
# flake8-bugbear
76+
"B",
77+
# flake8-simplify
78+
"SIM",
79+
# isort
80+
"I",
81+
]
82+
ignore = [
83+
# expand the list of ignored rules
84+
]

0 commit comments

Comments
 (0)