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.
This commit is contained in:
Charlie Marsh 2024-01-21 19:10:43 -05:00 committed by GitHub
parent 837984168a
commit a1f3cda190
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.