Skip to content

chore: enable ASYNC ruff rules #1528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/async_apple_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ async def async_run(self) -> None:
ALL_SERVICES,
**kwargs, # type: ignore[arg-type]
)
while True:
await asyncio.sleep(1)
await asyncio.Event().wait()

async def async_close(self) -> None:
assert self.aiozc is not None
Expand Down
3 changes: 1 addition & 2 deletions examples/async_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ async def async_run(self) -> None:
self.aiobrowser = AsyncServiceBrowser(
self.aiozc.zeroconf, services, handlers=[async_on_service_state_change]
)
while True:
await asyncio.sleep(1)
await asyncio.Event().wait()

async def async_close(self) -> None:
assert self.aiozc is not None
Expand Down
3 changes: 1 addition & 2 deletions examples/async_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ async def register_services(self, infos: list[AsyncServiceInfo]) -> None:
background_tasks = await asyncio.gather(*tasks)
await asyncio.gather(*background_tasks)
print("Finished registration, press Ctrl-C to exit...")
while True:
await asyncio.sleep(1)
await asyncio.Event().wait()

async def unregister_services(self, infos: list[AsyncServiceInfo]) -> None:
assert self.aiozc is not None
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ignore = [
"PERF401", # Cython: closures inside cpdef functions not yet supported
]
select = [
"ASYNC", # async rules
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"S", # flake8-bandit
Expand Down
Loading