mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Gate runtime-import-in-type-checking-block
(TCH004
) behind enabled flag (#5789)
Closes #5787.
This commit is contained in:
parent
6824b67f44
commit
f2e995f78d
1 changed files with 19 additions and 11 deletions
|
@ -5005,18 +5005,26 @@ impl<'a> Checker<'a> {
|
|||
.collect()
|
||||
};
|
||||
|
||||
flake8_type_checking::rules::runtime_import_in_type_checking_block(
|
||||
self,
|
||||
scope,
|
||||
&mut diagnostics,
|
||||
);
|
||||
if self.enabled(Rule::RuntimeImportInTypeCheckingBlock) {
|
||||
flake8_type_checking::rules::runtime_import_in_type_checking_block(
|
||||
self,
|
||||
scope,
|
||||
&mut diagnostics,
|
||||
);
|
||||
}
|
||||
|
||||
flake8_type_checking::rules::typing_only_runtime_import(
|
||||
self,
|
||||
scope,
|
||||
&runtime_imports,
|
||||
&mut diagnostics,
|
||||
);
|
||||
if self.any_enabled(&[
|
||||
Rule::TypingOnlyFirstPartyImport,
|
||||
Rule::TypingOnlyThirdPartyImport,
|
||||
Rule::TypingOnlyStandardLibraryImport,
|
||||
]) {
|
||||
flake8_type_checking::rules::typing_only_runtime_import(
|
||||
self,
|
||||
scope,
|
||||
&runtime_imports,
|
||||
&mut diagnostics,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if self.enabled(Rule::UnusedImport) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue