Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Zac-HD/flake8-async-archive
A flake8 plugin that checks bad async / asyncio practices
https://github.com/Zac-HD/flake8-async-archive
Last synced: 3 months ago
JSON representation
A flake8 plugin that checks bad async / asyncio practices
- Host: GitHub
- URL: https://github.com/Zac-HD/flake8-async-archive
- Owner: Zac-HD
- License: mit
- Archived: true
- Created: 2022-03-10T05:50:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T18:44:07.000Z (9 months ago)
- Last Synced: 2024-07-28T23:33:33.865Z (3 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-async - A flake8 plugin that checks for bad async / asyncio practices. (Bugs)
README
# The former `flake8-async` plugin has been merged with `flake8-trio`
Some years ago, @Zac-HD wanted to lint for async antipatterns, and together
with @cooperlees built out some initial checks in `flake8-async`. However,
it quickly became clear that many checks would need to specific to
[Trio](https://trio.readthedocs.io/en/stable/) (or
[anyio](https://anyio.readthedocs.io/en/stable/), or rarely asyncio),
and so Zac went on to create [flake8-trio](https://github.com/python-trio/flake8-trio/).Fast-forward to early 2024, and `flake8-trio` _also_ supports anyio,
which makes the name and error code pretty confusing. Since it's become
a strict superset of this plugin, we decided to merge them under the
`flake8-async` name and add asyncio support here too - which should
simplify both direct use, and downstream use via `ruff`.## List of warnings
- **ASYNC100**: Warning about the use of a blocking http call inside an `async def`
- **ASYNC101**: Warning about the use of `open`, `time.sleep` or methods in `subprocess`, inside an `async def`.
- **ASYNC102**: Warning about the use of unsafe methods in `os` inside an `async def`.## Development
When you wish to add a check to `flake8-async` please ensure the following:
- This `README.md` gets a one line about your new warning
- CHANGELOG gets added to a `## UNRELEASED` section
- Unittests are added showing the check hilight where it should and shouldn'tTo run our test suite please use tox.
```console
python3 -m venv --upgrade-deps /tmp/tfa
/tmp/tfa/bin/pip install tox
# Linting
/tmp/tfa/bin/tox -e check
# Test Running
/tmp/tfa/bin/tox -e test -- -n auto
```## License
MIT