Skip to content

Remove the test env machinery. Add a lint. #187

Description

@ecalifornica

Part of #183. Blocked on #184, #185, #186. No in-process code may read env before this starts.

Delete

  • ScopedHome, support::env_lock(), config::TEST_ENV_LOCK.
  • ScopedPath and cmd_resume's private duplicate, after cmd_resume takes the search path as a parameter.

Convert

  • config::search_path() is the single $PATH read. cmd_resume and cmd_export take the value as a parameter.
  • fuzzy.rs keeps its $PATH probe behind #[expect]. Where the value should live (a Config field or a threaded parameter) is decided in review; a follow-up PR removes the exception.
  • In-process tests construct Config and resolvers directly.
  • assert_cmd subprocess tests keep .env(). That call sets the child environment, not the global one.

Guard

  • Add a clippy disallowed-methods rule for std::env::{var, var_os, vars, vars_os, set_var, remove_var} across the workspace.
  • Add --all-targets to the clippy gate in scripts/quality_gates.sh, so the rule covers tests and examples.
  • Allow it with #[expect] in: path-cli's config module, fuzzy.rs (until the search-path decision), pathbase-client's build script (OUT_DIR is cargo's contract), and toolpath-cursor's real-env example and sanity test.
  • CI runs -D warnings already, so the rule is active on day one.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions