-
-
Notifications
You must be signed in to change notification settings - Fork 769
feat(tasks): add mise task validate command for task validation
#6958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds a comprehensive validation command for tasks that checks for common errors and issues including: - Circular dependencies between tasks - Missing task references in dependencies - Invalid #USAGE and #MISE directive parsing - Invalid timeout format validation - Duplicate alias detection across tasks - File existence verification for file-based tasks - Directory path and template validation - Shell command validation - Invalid glob pattern detection in sources/outputs - Run entry validation and empty task detection Features: - Human-readable output with colored error/warning indicators - JSON output format for CI/CD integration (--json) - Filter by severity (--errors-only) - Validate specific tasks or all tasks - Support for hidden tasks (--hidden) - Smart detection of meta-tasks (tasks with only dependencies) Exit codes: - 0: All validations passed (or only warnings) - 1: One or more errors found 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
mise task validate command for task validationmise task validate command for task validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new mise task validate command that performs comprehensive validation of task configurations to detect common errors and issues before runtime.
Key changes:
- Implements 11 validation checks including circular dependencies, missing references, timeout formats, alias conflicts, file existence, glob patterns, and more
- Supports both human-readable and JSON output formats for CI/CD integration
- Includes filtering options (
--errors-only,--hidden) and specific task validation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/cli/tasks/validate.rs | New module implementing the task validation command with 11 validation checks |
| src/cli/tasks/mod.rs | Registers the new validate subcommand in the tasks CLI module |
| e2e/tasks/test_task_validate | Comprehensive end-to-end test suite covering all validation scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/cli/tasks/validate.rs
Outdated
| category: "not-executable".to_string(), | ||
| message: format!("Task file is not executable: {}", file::display_path(file)), | ||
| details: Some( | ||
| "Consider making the file executable or setting 'hide=false'".to_string(), |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion mentions 'hide=false' but should be 'hide=true' since the default is hide=false and executable files without this flag would typically be auto-discovered as tasks.
| "Consider making the file executable or setting 'hide=false'".to_string(), | |
| "Consider making the file executable or setting 'hide=true'".to_string(), |
…e file warning - Only report duplicate alias conflicts once (for the first task alphabetically) instead of reporting for each task with the conflicting alias - Fix non-executable file warning to suggest 'chmod +x' instead of the confusing 'hide=false' suggestion which doesn't address executability
Fixes bug where validate_run_entries only checked task names and display names but not aliases, causing false positive errors when run entries referenced tasks by their aliases. Now uses a shared task_exists() helper that checks all three (name, display_name, and aliases) consistently.
Fixes inconsistency where task_exists() helper checked task aliases but get_specific_tasks() didn't, preventing users from running commands like `mise task validate b` when `b` is a task alias. Now both functions use the same lookup logic (name, display_name, and aliases). Added e2e test verifying task validation works with both task names and their aliases on the command line.
| .to_string(), | ||
| ), | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Validation Flags Platform-Specific Execution
The no-execution validation incorrectly fails tasks that have platform-specific run entries. The check uses task.run().is_empty() which returns different fields based on platform (either run or run_windows). A task with only run_windows defined will fail validation on non-Windows platforms even though it's valid, and vice versa. The validation should check both task.run and task.run_windows are empty instead of using the platform-dependent task.run() method.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.3 x -- echo |
19.5 ± 0.8 | 18.3 | 24.3 | 1.00 |
mise x -- echo |
19.7 ± 0.7 | 18.5 | 25.9 | 1.01 ± 0.06 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.3 env |
18.8 ± 0.6 | 18.0 | 24.6 | 1.00 |
mise env |
19.3 ± 0.9 | 18.2 | 25.4 | 1.02 ± 0.06 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.3 hook-env |
19.2 ± 0.8 | 18.1 | 24.7 | 1.00 |
mise hook-env |
20.4 ± 1.0 | 18.9 | 28.5 | 1.06 ± 0.07 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.3 ls |
16.7 ± 0.6 | 15.6 | 21.0 | 1.00 |
mise ls |
16.8 ± 0.7 | 15.8 | 21.6 | 1.01 ± 0.06 |
xtasks/test/perf
| Command | mise-2025.11.3 | mise | Variance |
|---|---|---|---|
| install (cached) | 108ms | 109ms | +0% |
| ls (cached) | 65ms | 65ms | +0% |
| bin-paths (cached) | 74ms | 74ms | +0% |
| task-ls (cached) | 436ms | 445ms | -2% |
### 📦 Registry - add xcsift by @alexey1312 in [#6923](#6923) - add tools: magika & xxh by @IceCodeNew in [#6909](#6909) - add aliases to aqua-backend tools by @IceCodeNew in [#6910](#6910) ### 🚀 Features - **(tasks)** add `mise task validate` command for task validation by @jdx in [#6958](#6958) ### 🐛 Bug Fixes - **(cli)** intercept --help flag to show task help instead of executing task by @jdx in [#6955](#6955) - remove temporary files after install by @vmeurisse in [#6948](#6948) ### 📚 Documentation - **(snapcraft)** update `summary` & `description` shown in snapcraft.io by @phanect in [#6926](#6926) - Change package example in go.md by @nachtjasmin in [#6862](#6862) - paranoid mode does not untrust global config by @iloveitaly in [#6952](#6952) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#6932](#6932) ### New Contributors - @iloveitaly made their first contribution in [#6952](#6952) - @nachtjasmin made their first contribution in [#6862](#6862) - @IceCodeNew made their first contribution in [#6910](#6910) - @alexey1312 made their first contribution in [#6923](#6923) ## 📦 Aqua Registry Updates #### New Packages (6) - [`CrociDB/bulletty`](https://github.com/CrociDB/bulletty) - [`Gaurav-Gosain/tuios`](https://github.com/Gaurav-Gosain/tuios) - [`ck-zhang/reddix`](https://github.com/ck-zhang/reddix) - [`hokaccha/spannerdef`](https://github.com/hokaccha/spannerdef) - [`lasantosr/intelli-shell`](https://github.com/lasantosr/intelli-shell) - [`zerocore-ai/microsandbox`](https://github.com/zerocore-ai/microsandbox) #### Updated Packages (4) - [`cue-lang/cue`](https://github.com/cue-lang/cue) - [`flutter/flutter`](https://github.com/flutter/flutter) - [`phiresky/ripgrep-all`](https://github.com/phiresky/ripgrep-all) - [`topgrade-rs/topgrade`](https://github.com/topgrade-rs/topgrade) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bump to 2025.11.4 with aqua-registry additions/updates, dependency/tooling refresh, updated completions/docs, and packaging/version files. > > - **Release/Versioning**: > - Bump to `2025.11.4` in `Cargo.toml`, `default.nix`, `packaging/rpm/mise.spec`, `snapcraft.yaml`, and `README.md`. > - **Aqua Registry**: > - *New packages*: `CrociDB/bulletty`, `Gaurav-Gosain/tuios`, `ck-zhang/reddix`, `hokaccha/spannerdef`, `lasantosr/intelli-shell`, `zerocore-ai/microsandbox` (owner change + aliases). > - *Updates*: `cue-lang/cue` (version rules), `flutter/flutter` (channelized URLs), `phiresky/ripgrep-all` (version/asset rules), `topgrade-rs/topgrade` (extensive version/asset overrides). > - **Dependencies/Tooling**: > - `Cargo.lock`: bump `aws-lc-*`, `hyper 1.8.0`, `indicatif 0.18.3`, `luajit-src`, `num-bigint-dig`, `crypto-common`, `usage-lib`, etc. > - `mise.lock`: update `bun`, `cargo-binstall`, `cargo-edit`, `node`, `pre-commit`, `usage-cli`. > - **Completions**: > - Update usage spec cache filenames to `usage__usage_spec_mise_2025_11_4.spec` in `completions/*`. > - **Docs**: > - Add `CHANGELOG.md` entry for `2025.11.4`; bump stars to `21.3k` in `docs/.vitepress/stars.data.ts`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a1e62ee. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Summary
Adds a comprehensive
mise task validatecommand that validates tasks for common errors and issues.Validation Checks
The command performs 11 types of validation:
Features
--json)--errors-only)--hidden)Exit Codes
0: All validations passed (or only warnings)1: One or more errors foundExamples
Test Coverage
e2e/tasks/test_task_validate)🤖 Generated with Claude Code
Note
Adds
mise tasks validateto validate tasks (human/JSON output, errors-only), with docs, manpage, completions, and e2e tests.src/cli/tasks/validate.rsand wire intosrc/cli/tasks/mod.rsasvalidatesubcommand.--jsonoutput and--errors-onlyfilter.docs/cli/tasks/validate.mdand list command indocs/cli/index.md,docs/cli/tasks.md.man/man1/mise.1and usage specmise.usage.kdl.docs/.vitepress/cli_commands.ts.xtasks/fig/src/mise.tsto includetasks validatewith options and args.e2e/tasks/test_task_validateexercising success, failures, JSON output, and flags.Written by Cursor Bugbot for commit 6e376f9. This will update automatically on new commits. Configure here.