astral-sh/ruff · error
Invalid `extend` value
Error message
Invalid `extend` value: {e} What it means
An anyhow error raised while resolving the `extend` option in a Ruff configuration file: the value failed shell expansion or path resolution, so the referenced configuration file cannot be located. This is a user-configuration error surfaced when settings are loaded.
Solutions
- Check that the `extend` path exists and is readable
- Fix any invalid shell variables or syntax in the `extend` value
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/ruff_workspace/src/configuration.rs:572 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of astral-sh/ruff@26f38c119c (2026-09-05).
Data as JSON: /api/errors/310d9d1e20d06160.
Report an issue: GitHub.
Appendix: source
Thrown at crates/ruff_workspace/src/configuration.rs:572
.map_err(|e| anyhow!("Invalid `cache-dir` value: {e}"))?,
exclude: options.exclude.map(|paths| {
paths
.into_iter()
.map(|pattern| {
let absolute = GlobPath::normalize(&pattern, project_root);
FilePattern::User(pattern, absolute)
})
.collect()
}),
extend: options
.extend
.map(|extend| {
let extend = shellexpand::full(&extend);
extend.map(|extend| PathBuf::from(extend.as_ref()))
})
.transpose()
.map_err(|e| anyhow!("Invalid `extend` value: {e}"))?,
extend_exclude: options
.extend_exclude
.map(|paths| {
paths
.into_iter()
.map(|pattern| {
let absolute = GlobPath::normalize(&pattern, project_root);
FilePattern::User(pattern, absolute)
})
.collect()
})
.unwrap_or_default(),
extend_include: options
.extend_include
.map(|paths| {
paths
.into_iter()
.map(|pattern| {View on GitHub (pinned to 26f38c119c)