Skip to content

Commit 350dcb8

Browse files
Include base pyproject when initializing cache settings (#9480)
## Summary Regression from https://github.com/astral-sh/ruff/pull/9453/files#diff-80a9c2637c432502a7075c792cc60db92282dd786999a78bfa9bb6f025afab35L482. Closes #9478. ## Test Plan ``` rm -rf .ruff_cache cargo run -p ruff_cli -- check ../foo.py ``` Failed prior to this PR; passes afterwards. The file must be outside of the current working directory, and must not have a `pyproject.toml` in any parent directory.
1 parent 55f8f3b commit 350dcb8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/ruff_workspace/src/resolver.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use anyhow::Result;
1111
use anyhow::{anyhow, bail};
1212
use globset::{Candidate, GlobSet};
1313
use ignore::{WalkBuilder, WalkState};
14-
use itertools::{Either, Itertools};
14+
use itertools::Itertools;
1515
use log::debug;
1616
use path_absolutize::path_dedot;
1717
use rustc_hash::{FxHashMap, FxHashSet};
@@ -204,12 +204,7 @@ impl<'a> Resolver<'a> {
204204

205205
/// Return an iterator over the resolved [`Settings`] in this [`Resolver`].
206206
pub fn settings(&self) -> impl Iterator<Item = &Settings> {
207-
match self.pyproject_config.strategy {
208-
PyprojectDiscoveryStrategy::Fixed => {
209-
Either::Left(std::iter::once(&self.pyproject_config.settings))
210-
}
211-
PyprojectDiscoveryStrategy::Hierarchical => Either::Right(self.settings.values()),
212-
}
207+
std::iter::once(&self.pyproject_config.settings).chain(self.settings.values())
213208
}
214209
}
215210

0 commit comments

Comments
 (0)