Skip to content

Commit 324ae92

Browse files
committed
check for a parent module in non-strict mode
1 parent aacbafd commit 324ae92

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/ruff_linter/src/rules/flake8_builtins/rules/stdlib_module_shadowing.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ pub(crate) fn stdlib_module_shadowing(
9393
return None;
9494
}
9595

96+
// not allowed generally, but check for a parent in non-strict mode
97+
if !settings.flake8_builtins.builtins_strict_checking && components.next().is_some() {
98+
return None;
99+
}
100+
96101
Some(Diagnostic::new(
97102
StdlibModuleShadowing {
98103
name: module_name.to_string(),

0 commit comments

Comments
 (0)