Skip to content

Commit 132c86c

Browse files
kwschulzclaude
andauthored
fix(capture): suppress mypy arg-type for page_load_strategy (#37)
* fix(capture): suppress mypy arg-type for Playwright page_load_strategy Playwright's page.goto() expects a Literal type for wait_until but the parameter is str for API flexibility. Pre-existing issue exposed by extraction into _run_browser_session(). Dual ignore covers both environments (with and without Playwright stubs). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(build): add playwright stubs to pre-commit mypy hook The mypy pre-commit hook ran without Playwright type stubs, so it treated all Playwright types as Any — hiding real type errors and flagging legitimate type: ignore comments as unused. Adding playwright>=1.40 to additional_dependencies makes the hook see the same types as the release script and local development. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Ken Schulz <kwschulz@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e5d95c1 commit 132c86c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ repos:
5353
- id: mypy
5454
additional_dependencies:
5555
- typer>=0.12
56+
- playwright>=1.40
5657
args: [--strict, --ignore-missing-imports]
5758
pass_filenames: false
5859
entry: mypy src/

src/har_capture/capture/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def _on_frame_navigated(frame: Any) -> None:
554554
page.wait_for_load_state("domcontentloaded")
555555
_quiescence_disabled[0] = True
556556
else:
557-
page.goto(target_url, wait_until=page_load_strategy)
557+
page.goto(target_url, wait_until=page_load_strategy) # type: ignore[arg-type]
558558

559559
if wait_for_data and not _quiescence_disabled[0]:
560560
_wait_for_network_quiescence(page)

0 commit comments

Comments
 (0)