[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:
TomerBin 2024-07-21 21:28:10 +03:00 committed by GitHub
parent 82355712c3
commit 053243635c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1009 additions and 5 deletions

View file

@ -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;
}
}