Skip to content

Commit fae6ade

Browse files
authored
chore: move to using Ruff (#140)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 9617a2b commit fae6ade

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.pre-commit-config.yaml

+5-11
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,12 @@ repos:
4040
- id: black
4141
files: ^(docs)
4242

43-
# Sort your imports in a standard form
44-
- repo: https://github.com/PyCQA/isort
45-
rev: 5.12.0
43+
# Lints code
44+
- repo: https://github.com/charliermarsh/ruff-pre-commit
45+
rev: "v0.0.252"
4646
hooks:
47-
- id: isort
48-
49-
# Upgrade older Python syntax
50-
- repo: https://github.com/asottile/pyupgrade
51-
rev: v3.3.1
52-
hooks:
53-
- id: pyupgrade
54-
args: ["--py36-plus"]
47+
- id: ruff
48+
args: ["--fix", "--show-fixes"]
5549

5650
# Changes tabs to spaces
5751
- repo: https://github.com/Lucas-C/pre-commit-hooks

docs/conf.py

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import os
15-
import sys
1614

1715
# If extensions (or modules to document with autodoc) are in another directory,
1816
# add these directories to sys.path here. If the directory is relative to the

pyproject.toml

+13
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ build-backend = "setuptools.build_meta"
88
[tool.cibuildwheel]
99
test-command = "python {project}/tests/test.py"
1010
test-skip = "*universal2:arm64"
11+
12+
[tool.ruff]
13+
extend-select = [
14+
"B", # flake8-bugbear
15+
"I", # isort
16+
"PGH", # pygrep-hooks
17+
"RUF", # Ruff-specific
18+
"UP", # pyupgrade
19+
]
20+
extend-ignore = [
21+
"E501", # Line too long
22+
]
23+
target-version = "py37"

setup.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import sys
2-
31
# Available at setup time due to pyproject.toml
4-
from pybind11 import get_cmake_dir
52
from pybind11.setup_helpers import Pybind11Extension, build_ext
63
from setuptools import setup
74

0 commit comments

Comments
 (0)