From a1f3cda19082d4075b13d161d1299142b1e63ce2 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 21 Jan 2024 19:10:43 -0500 Subject: [PATCH] Include global `--config` when determining namespace packages (#9603) ## Summary When determining whether _any_ settings have namespace packages, we need to consider the global settings (as would be provided via `--config`). This was a subtle fallout of a refactor. Closes https://github.com/astral-sh/ruff/issues/9579. ## Test Plan Tested locally by compiling Ruff and running against this [namespace-test](https://github.com/gokay05/namespace-test) repo. --- crates/ruff_workspace/src/resolver.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/ruff_workspace/src/resolver.rs b/crates/ruff_workspace/src/resolver.rs index d9bd592059672f..e8603226238e1a 100644 --- a/crates/ruff_workspace/src/resolver.rs +++ b/crates/ruff_workspace/src/resolver.rs @@ -173,8 +173,7 @@ impl<'a> Resolver<'a> { // Determine whether any of the settings require namespace packages. If not, we can save // a lookup for every file. let has_namespace_packages = self - .settings - .values() + .settings() .any(|settings| !settings.linter.namespace_packages.is_empty()); // Search for the package root for each file.