diff --git a/src/pyproject.rs b/src/pyproject.rs index 6895a20d41..ce20ef7092 100644 --- a/src/pyproject.rs +++ b/src/pyproject.rs @@ -13,13 +13,17 @@ pub fn load_config<'a>(paths: impl IntoIterator) -> Result<(Pat match find_project_root(paths) { Some(project_root) => match find_pyproject_toml(&project_root) { Some(path) => { - debug!("Found pyproject.toml at: {}", path.to_string_lossy()); - let pyproject = parse_pyproject_toml(&path)?; - let config = pyproject - .tool - .and_then(|tool| tool.ruff) - .unwrap_or_default(); - Ok((project_root, config)) + match parse_pyproject_toml(&path) { + Ok(pyproject) => { + debug!("Found pyproject.toml at: {}", path.to_string_lossy()); + let config = pyproject + .tool + .and_then(|tool| tool.ruff) + .unwrap_or_default(); + Ok((project_root, config)) + }, + Err(_) => Ok(Default::default()) + } } None => Ok(Default::default()), },