mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Adapt is-macro for a few enums (#3182)
This commit is contained in:
parent
0f37a98d91
commit
da98fab4ae
16 changed files with 110 additions and 125 deletions
|
@ -41,23 +41,22 @@ pub fn run(
|
|||
|
||||
// Initialize the cache.
|
||||
if cache.into() {
|
||||
fn init_cache(path: &std::path::Path) {
|
||||
if let Err(e) = cache::init(path) {
|
||||
error!(
|
||||
"Failed to initialize cache at {}: {e:?}",
|
||||
path.to_string_lossy()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
match &pyproject_strategy {
|
||||
PyprojectDiscovery::Fixed(settings) => {
|
||||
if let Err(e) = cache::init(&settings.cli.cache_dir) {
|
||||
error!(
|
||||
"Failed to initialize cache at {}: {e:?}",
|
||||
settings.cli.cache_dir.to_string_lossy()
|
||||
);
|
||||
}
|
||||
init_cache(&settings.cli.cache_dir);
|
||||
}
|
||||
PyprojectDiscovery::Hierarchical(default) => {
|
||||
for settings in std::iter::once(default).chain(resolver.iter()) {
|
||||
if let Err(e) = cache::init(&settings.cli.cache_dir) {
|
||||
error!(
|
||||
"Failed to initialize cache at {}: {e:?}",
|
||||
settings.cli.cache_dir.to_string_lossy()
|
||||
);
|
||||
}
|
||||
init_cache(&settings.cli.cache_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue