Repository navigation
Improve Python SDK linting rules and upgrade Ruff - #2995
antonvishal wants to merge 4 commits into
Conversation
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
# Conflicts: # packages/sdk-python/tests/test_cdp_client.py
why
Tighten linting rules for
packages/sdk-pythonto catch common bugs (mutable defaults, unchained exceptions, unescaped regexes) early.what changed
ruffto0.16.8and updateduv.lock.B: mutable default arguments (B006), useless comparisons/expressions (B015,B018), explicit exception chaining (B904).C4(comprehensions),PGH(strict type ignore comments).RUF: sorted__all__/__slots__(RUF022,RUF023), raw string regexes (RUF039), and stale noqa cleanup (RUF100).T10(debugger breakpoints),W(pycodestyle warnings), andexternal = ["S"].__all__insrc/stagehand/__init__.pyand__slots__inStagehandBrowser.raise cleanup_error from error).r"^...").test plan
uv run pytest: 562 passed, 1 skippeduv run ruff check .: all checks passeduv run ruff format --check .: 58 files checked, no formatting changes neededuv run ty check: all checks passeduv lock --check: passedSummary by cubic
Tightens linting for
packages/sdk-pythonso common bug patterns are caught in CI, and upgradesruffto0.16.8.__all__/__slots__.__all__and__slots__, chainingcleanup_errorfrom the originalerror, and converting test regex patterns to raw strings.external = ["S"]so Bandit security rules are excluded from the new lint set.uv.lockand confirmspytest,ruff,ty, anduv lock --checkall pass.Written for commit c164a96. Summary will update on new commits.