Skip to content

Commit 78cd3b4

Browse files
committed
build: switch to basedpyright & update pre-commit hooks
1 parent 55c1110 commit 78cd3b4

File tree

3 files changed

+71
-49
lines changed

3 files changed

+71
-49
lines changed

.pre-commit-config.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1+
default_install_hook_types:
2+
- pre-commit
3+
- post-checkout
4+
- post-merge
5+
- post-rewrite
16
repos:
2-
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.13
7+
- repo: https://github.com/astral-sh/uv-pre-commit
8+
rev: 0.8.4
49
hooks:
5-
- id: ruff
6-
args: ["--fix"]
7-
- id: ruff-format
8-
- repo: https://github.com/RobertCraigie/pyright-python
9-
rev: v1.1.381
10+
- id: uv-sync
11+
args: ["--all-groups"]
12+
13+
- repo: local
1014
hooks:
11-
- id: pyright
15+
- id: uv-basedpyright
16+
name: Run basedpyright via uv
17+
entry: uv run basedpyright
18+
language: system
19+
types: [python]
20+
21+
- id: uv-ruff-check
22+
name: Run ruff check via uv
23+
entry: uv run ruff check --fix
24+
language: system
25+
types: [python]
26+
27+
- id: uv-ruff-fmt
28+
name: Run ruff format via uv
29+
entry: uv run ruff format
30+
language: system
31+
types: [python]

pyproject.toml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ name = "FindMy"
33
version = "0.8.0"
44
description = "Everything you need to work with Apple's Find My network!"
55
readme = "README.md"
6-
authors = [
7-
{name = "Mike Almeloo", email = "git@mikealmel.ooo"},
8-
]
6+
authors = [{ name = "Mike Almeloo", email = "git@mikealmel.ooo" }]
97
license-files = ["LICENSE.md"]
108
requires-python = ">=3.9,<3.14"
119
dependencies = [
@@ -24,18 +22,13 @@ requires-python = ">=3.11"
2422
[dependency-groups]
2523
dev = [
2624
"pre-commit>=4.0.0,<5.0.0",
27-
"pyright>=1.1.391,<2.0.0",
25+
"basedpyright>=1.31.1,<2.0.0",
2826
"ruff>=0.8.4,<1.0.0",
2927
"tomli>=2.0.1,<3.0.0",
3028
"packaging>=25.0,<26.0",
3129
]
32-
test = [
33-
"pytest>=8.3.2,<9.0.0",
34-
]
35-
docs = [
36-
"sphinx>=8.2.3,<8.3.0",
37-
"sphinx-autoapi==3.6.0",
38-
]
30+
test = ["pytest>=8.3.2,<9.0.0"]
31+
docs = ["sphinx>=8.2.3,<8.3.0", "sphinx-autoapi==3.6.0"]
3932

4033
[tool.pyright]
4134
venvPath = "."
@@ -48,39 +41,35 @@ reportImplicitOverride = true
4841
[tool.ruff]
4942
line-length = 100
5043

51-
exclude = [
52-
"docs/",
53-
"tests/"
54-
]
44+
exclude = ["docs/", "tests/"]
5545

5646
[tool.ruff.lint]
57-
select = [
58-
"ALL",
59-
]
47+
select = ["ALL"]
6048
ignore = [
6149
"FIX002", # resolving TODOs
6250

6351
"D203", # one blank line before class docstring
6452
"D212", # multi-line docstring start at first line
6553
"D105", # docstrings in magic methods
6654

67-
"S101", # assert statements
68-
"S603", # false-positive subprocess call (https://github.com/astral-sh/ruff/issues/4045)
55+
"S101", # assert statements
56+
"S603", # false-positive subprocess call (https://github.com/astral-sh/ruff/issues/4045)
6957

7058
"PLR2004", # "magic" values >.>
7159
"FBT", # boolean "traps"
60+
"COM812", # trailing commas
7261
]
7362

7463
[tool.ruff.lint.per-file-ignores]
7564
"examples/*" = [
76-
"T201", # use of "print"
77-
"S101", # use of "assert"
78-
"D", # documentation
79-
"INP001", # namespacing
65+
"T201", # use of "print"
66+
"S101", # use of "assert"
67+
"D", # documentation
68+
"INP001", # namespacing
8069
]
8170
"scripts/*" = [
82-
"T201", # use of "print"
83-
"D", # documentation
71+
"T201", # use of "print"
72+
"D", # documentation
8473
]
8574

8675
[tool.setuptools]

uv.lock

Lines changed: 28 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)