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
21 changes: 1 addition & 20 deletions src/task/mod.rs
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};
Expand Down Expand Up @@ -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
}
Comment thread
cursor[bot] marked this conversation as resolved.
regex!(r"^(?:#|//|::)(?:MISE| ?\[MISE\]) ([a-z0-9_.-]+=[^\n]+)$").captures(line)
})
Comment on lines 307 to 309

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.

high

This change correctly removes support for the deprecated # mise syntax. However, this will likely cause the unit test test_from_path_invalid_toml (in this same file) to fail. That test asserts that invalid TOML in a # mise header causes an error. With this change, the line is simply ignored.

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]| {
Expand Down
Loading