-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(task): remove deprecated # mise task header syntax
#8403
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| use crate::cli::version::VERSION; | ||
| use crate::config::config_file::mise_toml::EnvList; | ||
| use crate::config::config_file::toml::{TrackingTomlParser, deserialize_arr}; | ||
| use crate::config::env_directive::{EnvDirective, EnvResolveOptions, EnvResults, ToolsFilter}; | ||
|
|
@@ -306,25 +305,7 @@ impl Task { | |
| let info = file::read_to_string(path)? | ||
| .lines() | ||
| .filter_map(|line| { | ||
| debug_assert!( | ||
| !VERSION.starts_with("2026.3"), | ||
| "remove old syntax `# mise`" | ||
| ); | ||
| if let Some(captures) = | ||
| regex!(r"^(?:#|//|::)(?:MISE| ?\[MISE\]) ([a-z0-9_.-]+=[^\n]+)$").captures(line) | ||
| { | ||
| Some(captures) | ||
| } else if let Some(captures) = regex!(r"^(?:#|//) mise ([a-z0-9_.-]+=[^\n]+)$") | ||
| .captures(line) | ||
| { | ||
| deprecated!( | ||
| "file_task_headers_old_syntax", | ||
| "The `# mise ...` syntax for task headers is deprecated and will be removed in mise 2026.3.0. Use the new `#MISE ...` syntax instead." | ||
| ); | ||
| Some(captures) | ||
| } else { | ||
| None | ||
| } | ||
| regex!(r"^(?:#|//|::)(?:MISE| ?\[MISE\]) ([a-z0-9_.-]+=[^\n]+)$").captures(line) | ||
| }) | ||
|
Comment on lines
307
to
309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly removes support for the deprecated Please consider updating the test to assert that parsing a file with the old syntax now succeeds without error. For example: #[tokio::test]
async fn test_from_path_invalid_toml() {
// ... setup ...
fs::write(
&task_path,
r#"#!/bin/bash
# mise description="test task"
# mise env={invalid=toml=here}
echo "hello world"
"#,
)
.unwrap();
let result = Task::from_path(&config, &task_path, temp_dir.path(), temp_dir.path()).await;
// The old `# mise` syntax is now ignored, so this should not produce an error.
assert!(result.is_ok());
} |
||
| .map(|captures| captures.extract().1) | ||
| .map(|[toml]| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.