{"record":{"id":"2bf213abdd7fc476","repo":"astral-sh/ruff","slug":"require-lazy-and-ban-lazy-must-not-overlap-aft","errorCode":null,"errorMessage":"`require-lazy` and `ban-lazy` must not overlap after applying exclusions","messagePattern":"`require-lazy` and `ban-lazy` must not overlap after applying exclusions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/options.rs","lineNumber":2249,"sourceCode":"            # Forbid lazy imports by default, while allowing specific exceptions.\n            ban-lazy = { include = \"all\", exclude = [\"typing\"] }\n        \"#\n    )]\n    ban_lazy: Option<ImportSelector>,\n}\n\nimpl Flake8TidyImportsOptions {\n    pub(crate) fn try_into_settings(self) -> Result<flake8_tidy_imports::settings::Settings> {\n        let mut banned_api = self.banned_api.unwrap_or_default();\n        if let Some(extend_banned_api) = self.extend_banned_api {\n            banned_api.extend(extend_banned_api);\n        }\n\n        let require_lazy = self.require_lazy.unwrap_or_default();\n        let ban_lazy = self.ban_lazy.unwrap_or_default();\n\n        if conflicting_lazy_import_settings(&require_lazy, &ban_lazy) {\n            return Err(anyhow!(\n                \"`require-lazy` and `ban-lazy` must not overlap after applying exclusions\"\n            ));\n        }\n\n        Ok(flake8_tidy_imports::settings::Settings {\n            ban_relative_imports: self.ban_relative_imports.unwrap_or(Strictness::Parents),\n            banned_api,\n            banned_module_level_imports: self.banned_module_level_imports.unwrap_or_default(),\n            require_lazy,\n            ban_lazy,\n        })\n    }\n}\n\nfn conflicting_lazy_import_settings(\n    require_lazy: &ImportSelector,\n    ban_lazy: &ImportSelector,\n) -> bool {","sourceCodeStart":2231,"sourceCodeEnd":2267,"githubUrl":"https://github.com/astral-sh/ruff/blob/5bb508f59481c1a02d5c7ff8568b9ffd8a763eef/crates/ruff_workspace/src/options.rs#L2231-L2267","documentation":"An anyhow error from the flake8-tidy-imports settings builder: after resolving include/exclude lists, `require-lazy` and `ban-lazy` select overlapping modules. A module cannot simultaneously be required to be lazy and banned from being lazy, so configuration is rejected.","triggerScenarios":"Thrown at crates/ruff_workspace/src/options.rs:2227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Adjust the include/exclude lists so require-lazy and ban-lazy no longer overlap","Remove one of the two conflicting settings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5bb508f59481c1a02d5c7ff8568b9ffd8a763eef","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}