python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
19 stars 2 forks source link

Add a `no_checkpoint_warning_decorators` setting #46

Closed Zac-HD closed 2 years ago

Zac-HD commented 2 years ago

Many async web frameworks provide something like Flask's @app.route(...) decorator, where functions have to be async. However this is also a case where it's fine not to have any checkpoints, if you have something like:

@app.route("/heartbeat")
async def heartbeat():
    return "ok"

So I'd like to support a no_checkpoint_warning_decorators option listing the names or dotted-names of decorators which should disable TRIO107 and 108 checks inside those functions, as we currently do for asynccontextmanager.

Zac-HD commented 2 years ago

Implemented in #53.