Warn on invalid uv.toml when provided via direct path (#14653)

## Summary

We validate the `uv.toml` when it's discovered automatically, but not
when provided via `--config-file`. The same limitations exist, though --
I think the lack of enforcement is just an oversight.

Closes https://github.com/astral-sh/uv/issues/14650.
This commit is contained in:
Charlie Marsh 2025-07-16 09:48:16 -04:00 committed by GitHub
parent 861f7a1c42
commit 03de6c36e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 2 deletions

View file

@ -170,7 +170,12 @@ impl FilesystemOptions {
/// Load a [`FilesystemOptions`] from a `uv.toml` file.
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, Error> {
Ok(Self(read_file(path.as_ref())?))
let path = path.as_ref();
tracing::debug!("Reading user configuration from: `{}`", path.display());
let options = read_file(path)?;
validate_uv_toml(path, &options)?;
Ok(Self(options))
}
}