ruff/crates
Charlie Marsh f8d46d09ef
Implement asyncio-dangling-task to track asyncio.create_task calls (#2935)
This rule guards against `asyncio.create_task` usages of the form:

```py
asyncio.create_task(coordinator.ws_connect())  # Error
```

...which can lead to unexpected bugs due to the lack of a strong reference to the created task. See Will McGugan's blog post for reference: https://textual.textualize.io/blog/2023/02/11/the-heisenbug-lurking-in-your-async-code/.

Note that we can't detect issues like:

```py
def f():
    # Stored as `task`, but never used...
    task = asyncio.create_task(coordinator.ws_connect())
```

So that would be a false negative. But this catches the common case of failing to assign the task in any way.

Closes #2809.
2023-02-15 15:19:03 -05:00
..
flake8_to_ruff Bump version to 0.0.247 (#2932) 2023-02-15 12:06:58 -05:00
ruff Implement asyncio-dangling-task to track asyncio.create_task calls (#2935) 2023-02-15 15:19:03 -05:00
ruff_cli Bump version to 0.0.247 (#2932) 2023-02-15 12:06:58 -05:00
ruff_dev [numpy] deprecated type aliases (#2810) 2023-02-14 23:45:12 +00:00
ruff_formatter Remove dependency on ruff_rowan (#2875) 2023-02-15 03:54:08 +00:00
ruff_macros Implement shell autocompletion for rule codes 2023-02-15 08:09:34 -05:00
ruff_python Add publish = false to unpublished crates (#2905) 2023-02-14 22:41:14 +00:00
ruff_python_formatter Respect self as positional-only argument in annotation rules (#2927) 2023-02-15 15:25:17 +00:00
ruff_text_size Add rome_formatter fork as ruff_formatter (#2872) 2023-02-14 19:22:55 -05:00