Skip to content

Commit fdc2244

Browse files
chore: update pre-commit hooks (#177)
* chore: update pre-commit hooks updates: - [github.com/psf/black-pre-commit-mirror: 23.9.1 → 23.10.1](psf/black-pre-commit-mirror@23.9.1...23.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.3](astral-sh/ruff-pre-commit@v0.0.292...v0.1.3) * chore: move to ruff-format Signed-off-by: Henry Schreiner <[email protected]> * chore: fix exclusion of main files from formatter Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <[email protected]>
1 parent ce14b7a commit fdc2244

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,13 @@ repos:
3333
- id: requirements-txt-fixer
3434
- id: trailing-whitespace
3535

36-
# Black, the code formatter, natively supports pre-commit
37-
- repo: https://github.com/psf/black-pre-commit-mirror
38-
rev: 23.9.1
39-
hooks:
40-
- id: black
41-
files: ^(docs)
42-
4336
# Lints code
4437
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
rev: "v0.0.292"
38+
rev: "v0.1.3"
4639
hooks:
4740
- id: ruff
4841
args: ["--fix", "--show-fixes"]
42+
- id: ruff-format
4943

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

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ requires = [
55
]
66
build-backend = "setuptools.build_meta"
77

8+
89
[tool.cibuildwheel]
910
test-command = "python {project}/tests/test.py"
1011
test-skip = "*universal2:arm64"
1112

13+
1214
[tool.ruff]
15+
target-version = "py37"
16+
17+
[tool.ruff.lint]
1318
extend-select = [
1419
"B", # flake8-bugbear
1520
"I", # isort
1621
"PGH", # pygrep-hooks
1722
"RUF", # Ruff-specific
1823
"UP", # pyupgrade
1924
]
20-
extend-ignore = [
21-
"E501", # Line too long
22-
]
23-
target-version = "py37"

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
# reproducible builds (https://github.com/pybind/python_example/pull/53)
1515

1616
ext_modules = [
17-
Pybind11Extension("python_example",
17+
Pybind11Extension(
18+
"python_example",
1819
["src/main.cpp"],
1920
# Example: passing in the version to the compiled code
20-
define_macros = [('VERSION_INFO', __version__)],
21-
),
21+
define_macros=[("VERSION_INFO", __version__)],
22+
),
2223
]
2324

2425
setup(

tests/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import python_example as m
22

3-
assert m.__version__ == '0.0.1'
3+
assert m.__version__ == "0.0.1"
44
assert m.add(1, 2) == 3
55
assert m.subtract(1, 2) == -1

0 commit comments

Comments
 (0)