mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-15 16:10:17 +00:00
[fastapi
] Implement FAST001
(fastapi-redundant-response-model
) and FAST002
(fastapi-non-annotated-dependency
) (#11579)
## Summary Implements ruff specific role for fastapi routes, and its autofix. ## Test Plan `cargo test` / `cargo insta review`
This commit is contained in:
parent
82355712c3
commit
053243635c
14 changed files with 1009 additions and 5 deletions
|
@ -1238,6 +1238,7 @@ impl<'a> SemanticModel<'a> {
|
|||
"dataclasses" => self.seen.insert(Modules::DATACLASSES),
|
||||
"datetime" => self.seen.insert(Modules::DATETIME),
|
||||
"django" => self.seen.insert(Modules::DJANGO),
|
||||
"fastapi" => self.seen.insert(Modules::FASTAPI),
|
||||
"logging" => self.seen.insert(Modules::LOGGING),
|
||||
"mock" => self.seen.insert(Modules::MOCK),
|
||||
"numpy" => self.seen.insert(Modules::NUMPY),
|
||||
|
@ -1824,6 +1825,7 @@ bitflags! {
|
|||
const BUILTINS = 1 << 18;
|
||||
const CONTEXTVARS = 1 << 19;
|
||||
const ANYIO = 1 << 20;
|
||||
const FASTAPI = 1 << 21;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue