Skip to content
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

[ruff] Ignore stub functions in unused-async (RUF029) #11026

Merged
merged 1 commit into from Apr 19, 2024

Conversation

charliermarsh
Copy link
Member

Summary

We should ignore methods that appear to be stubs, e.g.:

async def foo() -> int: ...

Closes #11018.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 19, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -103 violations, +0 -0 fixes in 5 projects; 39 projects unchanged)

DisnakeDev/disnake (+0 -29 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- disnake/utils.py:522:11: RUF029 Function `_assetbytes_to_base64_data` is declared `async`, but doesn't `await` or use `async` features.
- disnake/utils.py:527:11: RUF029 Function `_assetbytes_to_base64_data` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/autocomplete.py:31:11: RUF029 Function `languages_1` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/autocomplete.py:46:11: RUF029 Function `languages_2` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/converters.py:16:11: RUF029 Function `clean_command` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/converters.py:31:11: RUF029 Function `command_with_avatar` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/converters.py:50:11: RUF029 Function `command_with_clsmethod` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/converters.py:72:11: RUF029 Function `command_with_convmethod` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/injections.py:125:11: RUF029 Function `implicit_injection` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/injections.py:58:11: RUF029 Function `injected1` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/injections.py:72:11: RUF029 Function `injected2` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/param.py:23:11: RUF029 Function `simple` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/param.py:35:11: RUF029 Function `other_types` is declared `async`, but doesn't `await` or use `async` features.
- examples/interactions/param.py:47:11: RUF029 Function `description` is declared `async`, but doesn't `await` or use `async` features.
... 15 additional changes omitted for project

RasaHQ/rasa (+0 -7 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- rasa/core/channels/console.py:106:11: RUF029 Function `_get_user_input` is declared `async`, but doesn't `await` or use `async` features.
- rasa/core/channels/console.py:111:11: RUF029 Function `_get_user_input` is declared `async`, but doesn't `await` or use `async` features.
- tests/cli/test_rasa_export.py:243:15: RUF029 Function `close` is declared `async`, but doesn't `await` or use `async` features.
- tests/core/channels/test_slack.py:932:11: RUF029 Function `fake_on_new_message` is declared `async`, but doesn't `await` or use `async` features.
- tests/core/channels/test_telegram.py:16:11: RUF029 Function `noop` is declared `async`, but doesn't `await` or use `async` features.
- tests/core/test_broker.py:39:15: RUF029 Function `connect` is declared `async`, but doesn't `await` or use `async` features.
- tests/core/test_channels.py:38:11: RUF029 Function `noop` is declared `async`, but doesn't `await` or use `async` features.

apache/airflow (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- tests/providers/google/cloud/hooks/test_dataproc.py:68:11: RUF029 Function `mock_awaitable` is declared `async`, but doesn't `await` or use `async` features.

python/typeshed (+0 -65 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W

- stdlib/asyncio/staggered.pyi:8:11: RUF029 Function `staggered_race` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:29:15: RUF029 Function `open_connection` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:37:15: RUF029 Function `start_server` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:48:15: RUF029 Function `open_connection` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:57:15: RUF029 Function `start_server` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:70:19: RUF029 Function `open_unix_connection` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:73:19: RUF029 Function `start_unix_server` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:77:19: RUF029 Function `open_unix_connection` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/streams.pyi:80:19: RUF029 Function `start_unix_server` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:104:15: RUF029 Function `create_subprocess_shell` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:135:15: RUF029 Function `create_subprocess_exec` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:168:15: RUF029 Function `create_subprocess_shell` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:199:15: RUF029 Function `create_subprocess_exec` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:38:15: RUF029 Function `create_subprocess_shell` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/subprocess.pyi:70:15: RUF029 Function `create_subprocess_exec` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:342:15: RUF029 Function `sleep` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:344:15: RUF029 Function `sleep` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:345:15: RUF029 Function `wait_for` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:350:15: RUF029 Function `sleep` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:352:15: RUF029 Function `sleep` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:353:15: RUF029 Function `wait_for` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:357:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:361:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:367:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:371:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:377:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/tasks.pyi:385:15: RUF029 Function `wait` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/asyncio/threads.pyi:9:11: RUF029 Function `to_thread` is declared `async`, but doesn't `await` or use `async` features.
- stdlib/builtins.pyi:1252:15: RUF029 Function `anext` is declared `async`, but doesn't `await` or use `async` features.
- stubs/aiofiles/aiofiles/os.pyi:100:11: RUF029 Function `rmdir` is declared `async`, but doesn't `await` or use `async` features.
- stubs/aiofiles/aiofiles/os.pyi:103:11: RUF029 Function `removedirs` is declared `async`, but doesn't `await` or use `async` features.
... 34 additional changes omitted for project

zulip/zulip (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- zerver/lib/push_notifications.py:183:15: RUF029 Function `err_func` is declared `async`, but doesn't `await` or use `async` features.

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF029 103 0 103 0 0

@charliermarsh charliermarsh merged commit 06c248a into main Apr 19, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/async branch April 19, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unused-async (RUF029) - false positive in .pyi files
1 participant