mirror of https://github.com/astral-sh/ruff
[ty] Document path separator usage in `VendoredFileSystem`
Ref https://github.com/astral-sh/ruff/pull/19266#discussion_r2198530383
This commit is contained in:
parent
6ea231e458
commit
100d765ddf
|
|
@ -21,6 +21,19 @@ type LockedZipArchive<'a> = MutexGuard<'a, VendoredZipArchive>;
|
||||||
///
|
///
|
||||||
/// "Files" in the `VendoredFileSystem` are read-only and immutable.
|
/// "Files" in the `VendoredFileSystem` are read-only and immutable.
|
||||||
/// Directories are supported, but symlinks and hardlinks cannot exist.
|
/// Directories are supported, but symlinks and hardlinks cannot exist.
|
||||||
|
///
|
||||||
|
/// # Path separators
|
||||||
|
///
|
||||||
|
/// At time of writing (2025-07-11), this implementation always uses `/` as a
|
||||||
|
/// path separator, even in Windows environments where `\` is traditionally
|
||||||
|
/// used as a file path separator. Namely, this is only currently used with zip
|
||||||
|
/// files built by `crates/ty_vendored/build.rs`.
|
||||||
|
///
|
||||||
|
/// Callers using this may provide paths that use a `\` as a separator. It will
|
||||||
|
/// be transparently normalized to `/`.
|
||||||
|
///
|
||||||
|
/// This is particularly important because the presence of a trailing separator
|
||||||
|
/// in a zip file is conventionally used to indicate a directory entry.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct VendoredFileSystem {
|
pub struct VendoredFileSystem {
|
||||||
inner: Arc<Mutex<VendoredZipArchive>>,
|
inner: Arc<Mutex<VendoredZipArchive>>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue