Skip to content
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/prepare/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ impl PrepareEngine {
/// Discover all applicable prepare providers for the current project
///
/// Each config file's prepare providers are scoped to that config file's directory.
/// Prepare configs are NOT inherited from parent directories - a `[prepare.pnpm]`
/// defined in a root mise.toml only runs from the root, not from subdirectories.
/// Prepare configs are scoped to the directory where they are defined - a `[prepare.pnpm]`
/// in a root mise.toml only applies when running from that root, not from subdirectories.

Copilot AI Feb 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These doc comments read a bit awkwardly/ambiguously as written: (1) using a hyphen instead of an em dash or a full stop makes the sentence easier to misread, and (2) “in a root mise.toml” could be read as describing the command’s location rather than where the config is defined. Consider rephrasing to something like: “Prepare configs are scoped to the directory where they are defined. For example, a [prepare.pnpm] defined in the root mise.toml only applies when running from the root directory, not from subdirectories.”

Suggested change
/// Prepare configs are scoped to the directory where they are defined - a `[prepare.pnpm]`
/// in a root mise.toml only applies when running from that root, not from subdirectories.
/// Prepare configs are scoped to the directory where they are defined.
/// For example, a `[prepare.pnpm]` defined in the root `mise.toml` only applies when running
/// from the root directory, not from subdirectories.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The phrasing of the example could be clearer to avoid ambiguity. The phrase "only applies when running from that root" might be misinterpreted to mean it depends on the user's current working directory.

To make the scoping behavior more explicit, I suggest rephrasing the example to focus on where the provider's command executes. This clarifies that the execution context is tied to the config file's location, regardless of where mise is invoked.

Suggested change
/// Prepare configs are scoped to the directory where they are defined - a `[prepare.pnpm]`
/// in a root mise.toml only applies when running from that root, not from subdirectories.
/// Prepare configs are scoped to the directory where they are defined. For example, a `[prepare.pnpm]`
/// provider in a root `mise.toml` will execute in that root directory, not in subdirectories.

fn discover_providers(config: &Config) -> Result<Vec<Box<dyn PrepareProvider>>> {
let project_root = config
.project_root
Expand All @@ -99,7 +99,7 @@ impl PrepareEngine {
// Process each config file's prepare config independently, using that
// config file's directory as the project root for its providers.
// Only include config files that belong to the current project root
// (not inherited from parent directories).
// (skip config files from parent directories).

Copilot AI Feb 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor clarity: “skip config files from parent directories” could be interpreted as skipping all parent-directory configs unconditionally, rather than “skip config files that are outside the current project root.” Consider aligning wording with the preceding line (project-root membership), e.g. “(skip config files outside the current project root, e.g. from parent directories).”

Copilot uses AI. Check for mistakes.
for cf in config.config_files.values() {
let Some(prepare_config) = cf.prepare_config() else {
continue;
Expand Down
Loading