mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-07 00:50:37 +00:00
Adapt BoolLike to flags (#3175)
This commit is contained in:
parent
6e54cd8233
commit
c8c575dd43
5 changed files with 6 additions and 27 deletions
|
@ -40,7 +40,7 @@ pub fn run(
|
|||
}
|
||||
|
||||
// Initialize the cache.
|
||||
if matches!(cache, flags::Cache::Enabled) {
|
||||
if cache.into() {
|
||||
match &pyproject_strategy {
|
||||
PyprojectDiscovery::Fixed(settings) => {
|
||||
if let Err(e) = cache::init(&settings.cli.cache_dir) {
|
||||
|
|
|
@ -65,8 +65,7 @@ pub fn lint_path(
|
|||
// to cache `fixer::Mode::Apply`, since a file either has no fixes, or we'll
|
||||
// write the fixes to disk, thus invalidating the cache. But it's a bit hard
|
||||
// to reason about. We need to come up with a better solution here.)
|
||||
let metadata = if matches!(cache, flags::Cache::Enabled)
|
||||
&& matches!(autofix, fix::FixMode::None | fix::FixMode::Generate)
|
||||
let metadata = if cache.into() && matches!(autofix, fix::FixMode::None | fix::FixMode::Generate)
|
||||
{
|
||||
let metadata = path.metadata()?;
|
||||
if let Some(messages) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue