-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
FastAPI Depends() DI flagged by Flake8 Bugbear Linting #1522
Comments
|
Thanks for the help here @phy25 ! 👏 🙇 Yep, I think that should answer the question ✔️ |
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
For those who want to keep bugbear but not disable the checks entirely for every line that uses Depends, the following small plugin will amend bugbear's rules to recognize Depends as immutable, Unfortunately, BugBear does not provide a simpler configuration process.
For local usage, from setup.cfg, you can do:
|
Anyone using a
|
Using ruff, I had set this on pyproject.toml
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Flake8 Bugbear is a linting tool that points out potential bugs and design problems in applications. While doing linting on my FastAPI project, bugbear calls out:
... for any
Depends()
usage in a method signature, such as:I'm not flagging this as a bug, but just wanted to raise it to get your design opinion, as apparently someone out there thinks the
Depends()
pattern is not very pythonic.The text was updated successfully, but these errors were encountered: