Skip to content

Commit

Permalink
Include base pyproject when initializing cache settings
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 12, 2024
1 parent 55f8f3b commit 1fd067d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/ruff_workspace/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use anyhow::Result;
use anyhow::{anyhow, bail};
use globset::{Candidate, GlobSet};
use ignore::{WalkBuilder, WalkState};
use itertools::{Either, Itertools};
use itertools::Itertools;
use log::debug;
use path_absolutize::path_dedot;
use rustc_hash::{FxHashMap, FxHashSet};
Expand Down Expand Up @@ -204,12 +204,7 @@ impl<'a> Resolver<'a> {

/// Return an iterator over the resolved [`Settings`] in this [`Resolver`].
pub fn settings(&self) -> impl Iterator<Item = &Settings> {
match self.pyproject_config.strategy {
PyprojectDiscoveryStrategy::Fixed => {
Either::Left(std::iter::once(&self.pyproject_config.settings))
}
PyprojectDiscoveryStrategy::Hierarchical => Either::Right(self.settings.values()),
}
std::iter::once(&self.pyproject_config.settings).chain(self.settings.values())
}
}

Expand Down

0 comments on commit 1fd067d

Please sign in to comment.