Avoid `useless-import alias` (`C0414`) in `.pyi` files (#3761)

This commit is contained in:
Charlie Marsh 2023-03-27 14:27:03 -04:00 committed by GitHub
parent 5cb120327c
commit 450c6780ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -942,9 +942,11 @@ where
}
// pylint
if !self.is_stub {
if self.settings.rules.enabled(Rule::UselessImportAlias) {
pylint::rules::useless_import_alias(self, alias);
}
}
if self.settings.rules.enabled(Rule::ManualFromImport) {
pylint::rules::manual_from_import(self, stmt, alias, names);
}
@ -1419,12 +1421,14 @@ where
}
// pylint
if !self.is_stub {
if self.settings.rules.enabled(Rule::UselessImportAlias) {
pylint::rules::useless_import_alias(self, alias);
}
}
}
}
}
StmtKind::Raise { exc, .. } => {
if self.settings.rules.enabled(Rule::RaiseNotImplemented) {
if let Some(expr) = exc {