Skip to content

Commit ce94de9

Browse files
Enforce formatter checks and apply repository-wide formatting
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 1741877 commit ce94de9

36 files changed

+168
-93
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Lint
3838
run: python -m ruff check .
3939

40+
- name: Formatting
41+
run: python -m ruff format --check .
42+
4043
- name: Compile sources
4144
run: python -m compileall -q hyperbrowser examples tests
4245

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
.PHONY: install lint test build check
1+
.PHONY: install lint format-check format test build check
22

33
install:
44
python -m pip install -e . pytest ruff build
55

66
lint:
77
python -m ruff check .
88

9+
format-check:
10+
python -m ruff format --check .
11+
12+
format:
13+
python -m ruff format .
14+
915
test:
1016
python -m pytest -q
1117

1218
build:
1319
python -m build
1420

15-
check: lint test build
21+
check: lint format-check test build

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ except HyperbrowserTimeoutError:
167167
```bash
168168
pip install -e . pytest ruff build
169169
python -m ruff check .
170+
python -m ruff format --check .
170171
python -m pytest -q
171172
python -m build
172173
```

examples/sync_scrape.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def main() -> None:
2929
if result.data and result.data.markdown:
3030
print(result.data.markdown[:500])
3131
else:
32-
print(f"Scrape finished with status={result.status} and no markdown payload.")
32+
print(
33+
f"Scrape finished with status={result.status} and no markdown payload."
34+
)
3335

3436

3537
if __name__ == "__main__":

hyperbrowser/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
from .client.sync import Hyperbrowser
22
from .client.async_client import AsyncHyperbrowser
33
from .config import ClientConfig
4-
from .exceptions import HyperbrowserError, HyperbrowserPollingError, HyperbrowserTimeoutError
4+
from .exceptions import (
5+
HyperbrowserError,
6+
HyperbrowserPollingError,
7+
HyperbrowserTimeoutError,
8+
)
59
from .version import __version__
610

711
__all__ = [

hyperbrowser/client/managers/async_manager/agents/browser_use.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ async def start_and_wait(
6565
return await wait_for_job_result_async(
6666
operation_name=f"browser-use task job {job_id}",
6767
get_status=lambda: self.get_status(job_id).status,
68-
is_terminal_status=lambda status: status
69-
in {"completed", "failed", "stopped"},
68+
is_terminal_status=lambda status: (
69+
status in {"completed", "failed", "stopped"}
70+
),
7071
fetch_result=lambda: self.get(job_id),
7172
poll_interval_seconds=poll_interval_seconds,
7273
max_wait_seconds=max_wait_seconds,

hyperbrowser/client/managers/async_manager/agents/claude_computer_use.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ async def start_and_wait(
5959
return await wait_for_job_result_async(
6060
operation_name=f"Claude Computer Use task job {job_id}",
6161
get_status=lambda: self.get_status(job_id).status,
62-
is_terminal_status=lambda status: status
63-
in {"completed", "failed", "stopped"},
62+
is_terminal_status=lambda status: (
63+
status in {"completed", "failed", "stopped"}
64+
),
6465
fetch_result=lambda: self.get(job_id),
6566
poll_interval_seconds=poll_interval_seconds,
6667
max_wait_seconds=max_wait_seconds,

hyperbrowser/client/managers/async_manager/agents/cua.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ async def start_and_wait(
5757
return await wait_for_job_result_async(
5858
operation_name=f"CUA task job {job_id}",
5959
get_status=lambda: self.get_status(job_id).status,
60-
is_terminal_status=lambda status: status
61-
in {"completed", "failed", "stopped"},
60+
is_terminal_status=lambda status: (
61+
status in {"completed", "failed", "stopped"}
62+
),
6263
fetch_result=lambda: self.get(job_id),
6364
poll_interval_seconds=poll_interval_seconds,
6465
max_wait_seconds=max_wait_seconds,

hyperbrowser/client/managers/async_manager/agents/gemini_computer_use.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ async def start_and_wait(
5959
return await wait_for_job_result_async(
6060
operation_name=f"Gemini Computer Use task job {job_id}",
6161
get_status=lambda: self.get_status(job_id).status,
62-
is_terminal_status=lambda status: status
63-
in {"completed", "failed", "stopped"},
62+
is_terminal_status=lambda status: (
63+
status in {"completed", "failed", "stopped"}
64+
),
6465
fetch_result=lambda: self.get(job_id),
6566
poll_interval_seconds=poll_interval_seconds,
6667
max_wait_seconds=max_wait_seconds,

hyperbrowser/client/managers/async_manager/agents/hyper_agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ async def start_and_wait(
5959
return await wait_for_job_result_async(
6060
operation_name=f"HyperAgent task {job_id}",
6161
get_status=lambda: self.get_status(job_id).status,
62-
is_terminal_status=lambda status: status
63-
in {"completed", "failed", "stopped"},
62+
is_terminal_status=lambda status: (
63+
status in {"completed", "failed", "stopped"}
64+
),
6465
fetch_result=lambda: self.get(job_id),
6566
poll_interval_seconds=poll_interval_seconds,
6667
max_wait_seconds=max_wait_seconds,

0 commit comments

Comments
 (0)