Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion completions/_mise
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#compdef mise
# @generated by usage-cli from usage spec

#compdef mise
local curcontext="$curcontext"

# caching config
Expand Down
3 changes: 3 additions & 0 deletions e2e/backend/test_terraform
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

# Enable idiomatic version files for terraform
mise settings set idiomatic_version_file_enable_tools terraform

echo "1.10.0" >.terraform-version
assert_contains "mise tool terraform" "1.10.0"
3 changes: 3 additions & 0 deletions e2e/core/test_bun
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# Enable idiomatic version files for bun
mise settings set idiomatic_version_file_enable_tools bun

cat <<EOF >.bun-version
1.1.21
EOF
Expand Down
3 changes: 3 additions & 0 deletions e2e/core/test_deno
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ cat <<EOF >.deno-version
1.43.3
EOF

# Enable idiomatic version files for deno
mise settings set idiomatic_version_file_enable_tools deno

mise i deno
assert_contains "mise x deno -- deno -V" "deno 1.43.3"
3 changes: 3 additions & 0 deletions e2e/core/test_java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# Enable idiomatic version files for java
mise settings set idiomatic_version_file_enable_tools java

cat <<EOF >.sdkmanrc
java=17.0.2
EOF
Expand Down
3 changes: 3 additions & 0 deletions e2e/core/test_node_slow
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ latest=$(mise latest node)
echo "v$latest" >.node-version
echo "zx" >"$MISE_NODE_DEFAULT_PACKAGES_FILE"

# Enable idiomatic version files for node
mise settings set idiomatic_version_file_enable_tools node

mise i node@lts/hydrogen
mise i -f node
assert_contains "mise x node@lts/hydrogen -- node --version" "v18."
Expand Down
6 changes: 5 additions & 1 deletion e2e/core/test_python_precompiled
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ assert_contains "mise x -- python --version" "Python 3.12.3"
rm mise.toml
mise rm python@3.12.3

# Enable idiomatic version files for python
mise settings set idiomatic_version_file_enable_tools python

echo '3.12.3' >.python-version
assert_contains "mise i 2>&1" "mise python@3.12.3"
assert_contains "mise x -- python --version" "Python 3.12.3"

mise settings idiomatic_version_file_disable_tools python
# Disable idiomatic version files for python to test override behavior
mise settings set idiomatic_version_file_enable_tools "[]"
mise use python@3.13
assert_contains "mise x -- python --version" "Python 3.13"
3 changes: 3 additions & 0 deletions e2e/core/test_ruby_from_gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
# Read ruby version from Gemfile

# Enable idiomatic version files for ruby
mise settings set idiomatic_version_file_enable_tools ruby

cat >Gemfile <<EOF
ruby "3.3.6"
EOF
Expand Down
4 changes: 4 additions & 0 deletions e2e/plugins/test_tiny
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ MISE_TINY_LIST_ALL_FAIL=1 MISE_TINY_VERSION=latest mise env >/dev/null
# check bin/list-legacy-files
assert "mise current tiny" "3.1.0"
mise local --remove tiny

# Enable idiomatic version files for tiny
mise settings set idiomatic_version_file_enable_tools tiny

echo "2.0" >.tiny-version
assert "mise current tiny" "2.0.1"
rm .tiny-version
Expand Down
2 changes: 1 addition & 1 deletion schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@
"type": "number"
},
"idiomatic_version_file": {
"default": true,
"description": "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc.",
"type": "boolean",
"deprecated": true
Expand All @@ -679,6 +678,7 @@
}
},
"idiomatic_version_file_enable_tools": {
"default": [],
"description": "Specific tools to enable idiomatic version files for like .node-version, .ruby-version, etc.",
"type": "array",
"items": {
Expand Down
17 changes: 15 additions & 2 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ env = "MISE_HTTP_RETRIES"
type = "Integer"

[idiomatic_version_file]
default = true
deprecated = "This has been replaced with the idiomatic_version_file_enable_tools setting."
description = "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc."
docs = """
Expand All @@ -508,22 +507,36 @@ information.
Set to "false" to disable idiomatic version file parsing.
"""
env = "MISE_IDIOMATIC_VERSION_FILE"
hide = true
optional = true
type = "Bool"

[idiomatic_version_file_disable_tools]
default = []
deprecated = "This has been replaced with the idiomatic_version_file_enable_tools setting."
description = "Specific tools to disable idiomatic version files for."
env = "MISE_IDIOMATIC_VERSION_FILE_DISABLE_TOOLS"
hide = true
parse_env = "set_by_comma"
rust_type = "BTreeSet<String>"
type = "SetString"

[idiomatic_version_file_enable_tools]
default = []
description = "Specific tools to enable idiomatic version files for like .node-version, .ruby-version, etc."
docs = """
By default, idiomatic version files are disabled. You can enable them for specific tools with this setting.

For example, to enable idiomatic version files for node and python:

mise settings add idiomatic_version_file_enable_tools node
mise settings add idiomatic_version_file_enable_tools python

See [Idiomatic Version Files](/configuration.html#idiomatic-version-files) for more information.
"""
env = "MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS"
parse_env = "set_by_comma"
rust_type = "Option<BTreeSet<String>>"
rust_type = "BTreeSet<String>"
type = "SetString"

[ignored_config_paths]
Expand Down
69 changes: 6 additions & 63 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use config_file::ConfigFileType;
use eyre::{Context, Result, bail, eyre};
use indexmap::{IndexMap, IndexSet};
use itertools::Itertools;
Expand All @@ -14,6 +13,8 @@ use std::time::Duration;
use tokio::{sync::OnceCell, task::JoinSet};
use walkdir::WalkDir;

use crate::backend::ABackend;
use crate::cli::version;

Copilot AI Oct 1, 2025

Copy link

Choose a reason for hiding this comment

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

These new imports appear to be unused after removing the deprecation warning logic. The version import was previously used in the removed warn_about_idiomatic_version_files function.

Suggested change
use crate::cli::version;

Copilot uses AI. Check for mistakes.
use crate::config::config_file::idiomatic_version::IdiomaticVersionFile;
use crate::config::config_file::min_version::MinVersionSpec;
use crate::config::config_file::mise_toml::{MiseToml, Tasks};
Expand All @@ -27,8 +28,6 @@ use crate::task::Task;
use crate::toolset::{ToolRequestSet, ToolRequestSetBuilder, ToolVersion, Toolset, install_state};
use crate::ui::style;
use crate::{backend, dirs, env, file, lockfile, registry, runtime_symlinks, shims, timeout};
use crate::{backend::ABackend, cli::version::VERSION};
use crate::{backend::Backend, cli::version};

pub mod config_file;
pub mod env_directive;
Expand Down Expand Up @@ -126,9 +125,6 @@ impl Config {
let config_files = measure!("config::load config_files", {
load_all_config_files(&config_paths, &idiomatic_files).await?
});
measure!("config::load warn_about_idiomatic_version_files", {
warn_about_idiomatic_version_files(&config_files);
});

let mut config = Self {
tera_ctx: BASE_CONTEXT.clone(),
Expand Down Expand Up @@ -703,7 +699,8 @@ fn get_project_root(config_files: &ConfigMap) -> Option<PathBuf> {
}

async fn load_idiomatic_files() -> BTreeMap<String, Vec<String>> {
if !Settings::get().idiomatic_version_file {
let enable_tools = Settings::get().idiomatic_version_file_enable_tools.clone();
if enable_tools.is_empty() {
return BTreeMap::new();
}
if !Settings::get()
Expand All @@ -716,23 +713,10 @@ async fn load_idiomatic_files() -> BTreeMap<String, Vec<String>> {
);
}
let mut jset = JoinSet::new();
let tool_is_enabled = |tool: &dyn Backend| {
if let Some(enable_tools) = &Settings::get().idiomatic_version_file_enable_tools {
enable_tools.contains(tool.id())
} else if !Settings::get()
.idiomatic_version_file_disable_tools
.is_empty()
{
!Settings::get()
.idiomatic_version_file_disable_tools
.contains(tool.id())
} else {
true
}
};
for tool in backend::list() {
let enable_tools = enable_tools.clone();
jset.spawn(async move {
if !tool_is_enabled(&*tool) {
if !enable_tools.contains(tool.id()) {
return vec![];
}
match tool.idiomatic_filenames().await {
Expand Down Expand Up @@ -1302,47 +1286,6 @@ pub async fn rebuild_shims_and_runtime_symlinks(
Ok(())
}

fn warn_about_idiomatic_version_files(config_files: &ConfigMap) {
if Settings::get()
.idiomatic_version_file_enable_tools
.as_ref()
.is_some()
{
return;
}
debug_assert!(
!VERSION.starts_with("2025.10"),
"default idiomatic version files to disabled"
);
let Some((p, tool)) = config_files
.iter()
.filter(|(_, cf)| cf.config_type() == ConfigFileType::IdiomaticVersion)
.filter_map(|(p, cf)| cf.to_tool_request_set().ok().map(|ts| (p, ts.tools)))
.filter_map(|(p, tools)| tools.first().map(|(ba, _)| (p, ba.to_string())))
.next()
else {
return;
};
deprecated!(
"idiomatic_version_file_enable_tools",
r#"
Idiomatic version files like {} are currently enabled by default. However, this will change in mise 2025.10.0 to instead default to disabled.

You can remove this warning by explicitly enabling idiomatic version files for {} with:

mise settings add idiomatic_version_file_enable_tools {}

You can disable idiomatic version files with:

mise settings add idiomatic_version_file_enable_tools "[]"

See https://github.com/jdx/mise/discussions/4345 for more information."#,
display_path(p),
tool,
tool
);
}

async fn load_local_tasks(config: &Arc<Config>) -> Result<Vec<Task>> {
let mut tasks = vec![];
for d in file::all_dirs()? {
Expand Down
2 changes: 1 addition & 1 deletion src/config/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl Settings {

settings = sb.load()?;
if !settings.legacy_version_file {
settings.idiomatic_version_file = false;
settings.idiomatic_version_file = Some(false);

Copilot AI Oct 1, 2025

Copy link

Choose a reason for hiding this comment

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

This assignment suggests idiomatic_version_file is now an Option<bool> type, but the change from false to Some(false) indicates a type mismatch that may cause compilation issues. Verify that the field type has been updated accordingly in the Settings struct definition.

Copilot uses AI. Check for mistakes.
}
if settings.raw {
settings.jobs = 1;
Expand Down
Loading