Skip to content

Commit 3ff182c

Browse files
CopilotSigureMo
andauthored
🏷️ types: move to ty (#47)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SigureMo <38436475+SigureMo@users.noreply.github.com>
1 parent 9ab8978 commit 3ff182c

7 files changed

Lines changed: 34 additions & 48 deletions

File tree

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"recommendations": [
33
"ms-python.python",
4-
"ms-python.vscode-pylance",
4+
"astral-sh.ty",
55
"charliermarsh.ruff",
66
"esbenp.prettier-vscode",
77
"EditorConfig.EditorConfig",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ All output follows consistent formatting rules so both humans and LLMs can parse
327327

328328
```bash
329329
uv run ruff check
330-
uv run pyright
330+
uv run ty check --error-on-warning src/gh_llm tests
331331
uv run pytest -q
332332
```
333333

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fmt:
1212
prettier --write '**/*.md'
1313

1414
lint:
15-
uv run pyright src/gh_llm tests
15+
uv run ty check --error-on-warning src/gh_llm tests
1616
uv run ruff check .
1717

1818
fmt-docs:

pyproject.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,12 @@ gh-llm = "gh_llm.__main__:main"
3030

3131
[dependency-groups]
3232
dev = [
33-
"pyright>=1.1.407",
33+
"ty>=0.0.32",
3434
"ruff>=0.14.10",
3535
"pytest>=9.0.2",
3636
"pytest-rerunfailures>=16.1",
3737
]
3838

39-
[tool.pyright]
40-
include = ["src/gh_llm", "tests"]
41-
pythonVersion = "3.14"
42-
typeCheckingMode = "strict"
43-
4439
[tool.ruff]
4540
line-length = 120
4641
target-version = "py314"
@@ -85,8 +80,6 @@ select = [
8580
]
8681
ignore = [
8782
"E501", # line too long, duplicate with ruff fmt
88-
"F401", # imported but unused, duplicate with pyright
89-
"F841", # local variable is assigned to but never used, duplicate with pyright
9083
]
9184
future-annotations = true
9285

src/gh_llm/pr_body.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def build_pull_request_body_scaffold(
7979

8080
existing_titles = {normalize_section_title(title) for title in extract_markdown_section_titles(cleaned_template)}
8181
added_sections: list[str] = []
82-
blocks = [cleaned_template]
82+
blocks: list[str] = [cleaned_template]
8383

8484
for section in required_sections:
8585
normalized = normalize_section_title(section)

tests/test_cli.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ def test_extract_diff_hunks_prefers_first_added_line_for_right_side() -> None:
15761576
]
15771577
)
15781578

1579-
hunks = pr_commands._extract_diff_hunks(diff) # pyright: ignore[reportPrivateUsage]
1579+
hunks = pr_commands._extract_diff_hunks(diff)
15801580

15811581
assert len(hunks) == 1
15821582
assert hunks[0].path == "paddle/phi/kernels/funcs/abs.h"
@@ -1602,7 +1602,7 @@ def test_extract_diff_hunks_uses_real_new_file_line_numbers_on_right_side() -> N
16021602
]
16031603
)
16041604

1605-
hunks = pr_commands._extract_diff_hunks(diff) # pyright: ignore[reportPrivateUsage]
1605+
hunks = pr_commands._extract_diff_hunks(diff)
16061606

16071607
assert len(hunks) == 1
16081608
assert hunks[0].path == "src/gh_llm/commands/pr.py"
@@ -1612,7 +1612,7 @@ def test_extract_diff_hunks_uses_real_new_file_line_numbers_on_right_side() -> N
16121612

16131613

16141614
def test_render_numbered_hunk_lines_preserves_real_right_side_line_numbers() -> None:
1615-
hunk = pr_commands._DiffHunk( # pyright: ignore[reportPrivateUsage]
1615+
hunk = pr_commands._DiffHunk(
16161616
path="src/gh_llm/commands/pr.py",
16171617
header="@@ -890,6 +890,7 @@ def _extract_diff_hunks(diff: str) -> list[_DiffHunk]:",
16181618
anchor_line=893,
@@ -1631,7 +1631,7 @@ def test_render_numbered_hunk_lines_preserves_real_right_side_line_numbers() ->
16311631
match_paths={"src/gh_llm/commands/pr.py"},
16321632
)
16331633

1634-
rendered = pr_commands._render_numbered_hunk_lines(hunk) # pyright: ignore[reportPrivateUsage]
1634+
rendered = pr_commands._render_numbered_hunk_lines(hunk)
16351635

16361636
assert "L 890 R 890 | current_hunk_lines: list[str] = []" in rendered
16371637
assert "L 891 R 891 | current_old_line = 0" in rendered
@@ -1640,7 +1640,7 @@ def test_render_numbered_hunk_lines_preserves_real_right_side_line_numbers() ->
16401640

16411641

16421642
def test_inline_review_thread_blocks_do_not_fallback_from_current_right_anchor_to_original_left_line() -> None:
1643-
current_hunk = pr_commands._DiffHunk( # pyright: ignore[reportPrivateUsage]
1643+
current_hunk = pr_commands._DiffHunk(
16441644
path="paddle/phi/api/include/compat/ATen/ops/from_blob.h",
16451645
header="@@ -18,3 +80,4 @@",
16461646
anchor_line=81,
@@ -1654,7 +1654,7 @@ def test_inline_review_thread_blocks_do_not_fallback_from_current_right_anchor_t
16541654
right_commentable_lines={80, 81, 82},
16551655
match_paths={"paddle/phi/api/include/compat/ATen/ops/from_blob.h"},
16561656
)
1657-
stale_hunk = pr_commands._DiffHunk( # pyright: ignore[reportPrivateUsage]
1657+
stale_hunk = pr_commands._DiffHunk(
16581658
path="paddle/phi/api/include/compat/ATen/ops/from_blob.h",
16591659
header="@@ -80,4 +210,1 @@",
16601660
anchor_line=210,
@@ -1684,7 +1684,7 @@ def test_inline_review_thread_blocks_do_not_fallback_from_current_right_anchor_t
16841684
comments=(),
16851685
)
16861686

1687-
blocks_by_hunk = pr_commands._build_inline_review_thread_blocks_for_file( # pyright: ignore[reportPrivateUsage]
1687+
blocks_by_hunk = pr_commands._build_inline_review_thread_blocks_for_file(
16881688
hunks=[current_hunk, stale_hunk],
16891689
summaries=[summary],
16901690
extra_contexts=[None, None],
@@ -2897,7 +2897,7 @@ def test_pr_body_template_finds_docs_template_directory(
28972897

28982898
def test_decode_repository_contents_text_returns_none_for_invalid_base64() -> None:
28992899
payload: dict[str, object] = {"encoding": "base64", "content": "A"}
2900-
assert github_api._decode_repository_contents_text(payload) is None # pyright: ignore[reportPrivateUsage]
2900+
assert github_api._decode_repository_contents_text(payload) is None
29012901

29022902

29032903
def test_pr_body_template_surfaces_non_404_lookup_failures(

uv.lock

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

0 commit comments

Comments
 (0)