Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ disallowed-methods = [
{ path = "str::replace", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replace` instead." },
{ path = "str::replacen", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replacen` instead." },
{ path = "std::env::current_dir", reason = "To get an `AbsolutePathBuf`, Use `vite_path::current_dir` instead." },
{ path = "std::env::vars_os", reason = "Read process env only in `Session::init`, then use the session env snapshot downstream." },
{ path = "std::thread::sleep", reason = "Use proper synchronization (channels, condvars, etc.) instead of sleeping. Sleep is only acceptable for intentional user-facing delays (e.g. animations, debouncing)." },
{ path = "tokio::time::sleep", reason = "Use proper synchronization (channels, signals, etc.) instead of sleeping. Sleep is only acceptable for intentional user-facing delays (e.g. animations, debouncing)." },
]
Expand Down
4 changes: 4 additions & 0 deletions crates/vite_task/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ impl<'a> Session<'a> {
/// if workspace initialization fails.
#[tracing::instrument(level = "debug", skip_all)]
pub fn init(config: SessionConfig<'a>) -> anyhow::Result<Self> {
#[expect(
clippy::disallowed_methods,
reason = "Session::init is the only place that bootstraps the session env snapshot"
)]
let envs = std::env::vars_os()
.map(|(k, v)| (Arc::<OsStr>::from(k.as_os_str()), Arc::<OsStr>::from(v.as_os_str())))
.collect();
Expand Down
Loading