Skip to content
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

feat: added special "_" portion of mise.toml for custom data #3259

Merged
merged 1 commit into from
Nov 28, 2024
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
4 changes: 4 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ experimental = true # enable experimental features

# configure messages displayed when entering directories with config files
status = { missing_tools = "if_other_versions_installed", show_env = false, show_tools = false }

# "_" is a special key for information you'd like to put into mise.toml that mise will never parse
[_]
foo = "bar"
```

## System config: `/etc/mise/config.toml`
Expand Down
3 changes: 3 additions & 0 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@
},
"description": "dev tools to use",
"type": "object"
},
"_": {
"additionalProperties": true
}
}
}
3 changes: 3 additions & 0 deletions src/config/config_file/mise_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use crate::{dirs, file};

#[derive(Default, Deserialize)]
pub struct MiseToml {
#[serde(rename = "_")]
custom: Option<toml::Value>,
#[serde(default, deserialize_with = "deserialize_version")]
min_version: Option<Versioning>,
#[serde(skip)]
Expand Down Expand Up @@ -482,6 +484,7 @@ impl Debug for MiseToml {
impl Clone for MiseToml {
fn clone(&self) -> Self {
Self {
custom: self.custom.clone(),
min_version: self.min_version.clone(),
context: self.context.clone(),
path: self.path.clone(),
Expand Down