Skip to content

Commit 900248a

Browse files
committed
Add RUF rules
1 parent c93d1c8 commit 900248a

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ exclude = [
6161

6262
line-length = 100
6363
target-version = "py38"
64+
preview = true
65+
unsafe-fixes = true
6466

6567
exclude = [
6668
"typeshed_client/typeshed",
@@ -81,6 +83,7 @@ select = [
8183
"UP", # pyupgrade
8284
"PIE",
8385
"PERF",
86+
"RUF", # Ruff's own rules
8487
]
8588

8689
ignore = [

typeshed_client/__init__.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424

2525
__all__ = [
26-
"__version__",
27-
"get_stub_ast",
28-
"get_stub_file",
29-
"get_all_stub_files",
30-
"get_search_context",
31-
"SearchContext",
32-
"ModulePath",
33-
"get_stub_names",
34-
"parse_ast",
26+
"ImportedInfo",
3527
"ImportedName",
28+
"ModulePath",
3629
"NameDict",
3730
"NameInfo",
3831
"OverloadedName",
39-
"ImportedInfo",
4032
"Resolver",
33+
"SearchContext",
34+
"__version__",
35+
"get_all_stub_files",
36+
"get_search_context",
37+
"get_stub_ast",
38+
"get_stub_file",
39+
"get_stub_names",
40+
"parse_ast",
4141
]

typeshed_client/finder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def get_search_path(typeshed_dir: Path, pyversion: Tuple[int, int]) -> Tuple[Pat
217217
f"{pyversion[0]}.{minor}" for minor in reversed(range(pyversion[1] + 1))
218218
]
219219
# E.g. for Python 3.2, try 3.2/, 3.1/, 3.0/, 3/, 2and3/.
220-
for version in versions + [str(pyversion[0]), "2and3"]:
220+
for version in [*versions, str(pyversion[0]), "2and3"]:
221221
for lib_type in ("stdlib", "third_party"):
222222
stubdir = typeshed_dir / lib_type / version
223223
if stubdir.is_dir():

0 commit comments

Comments
 (0)