Skip to content

Commit

Permalink
env-man
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 26, 2024
1 parent b76d21c commit 577749b
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 122 deletions.
2 changes: 1 addition & 1 deletion e2e/test_go_install
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ source "$(dirname "$0")/assert.sh"
export MISE_EXPERIMENTAL=1

assert "mise x go:github.com/DarthSim/hivemind@v1.1.0 -- hivemind --version" "Hivemind version 1.1.0"
chmod -R u+w "$MISE_DATA_DIR/cache/go-"*
chmod -R u+w "$MISE_DATA_DIR/cache/go-"* || true
252 changes: 137 additions & 115 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"description": "mise settings",
"type": "object",
"additionalProperties": false,
"properties": { "$ref": "#/$defs/settings" }
"$ref": "#/$defs/settings"
}
},
"$defs": {
Expand Down Expand Up @@ -221,126 +221,148 @@
]
},
"settings": {
"activate_aggressive": {
"description": "push tools to the front of PATH instead of allowing modifications of PATH after activation to take precedence",
"type": "boolean"
},
"all_compile": {
"description": "do not use precompiled binaries for any tool",
"type": "boolean"
},
"always_keep_download": {
"description": "should mise keep downloaded files after installation",
"type": "boolean"
},
"always_keep_install": {
"description": "should mise keep install files after installation even if the installation fails",
"type": "boolean"
},
"asdf_compat": {
"description": "set to true to ensure .tool-versions will be compatible with asdf",
"type": "boolean"
},
"cargo_binstall": {
"description": "use cargo-binstall to install rust tools if available",
"type": "boolean",
"default": true
},
"color": {
"description": "colorize output",
"type": "boolean",
"default": true
},
"disable_default_shorthands": {
"description": "disables built-in shorthands",
"type": "boolean"
},
"disable_tools": {
"description": "tools that should not be used",
"items": {
"description": "tool name",
"properties": {
"activate_aggressive": {
"description": "push tools to the front of PATH instead of allowing modifications of PATH after activation to take precedence",
"type": "boolean"
},
"all_compile": {
"description": "do not use precompiled binaries for any tool",
"type": "boolean"
},
"always_keep_download": {
"description": "should mise keep downloaded files after installation",
"type": "boolean"
},
"always_keep_install": {
"description": "should mise keep install files after installation even if the installation fails",
"type": "boolean"
},
"asdf_compat": {
"description": "set to true to ensure .tool-versions will be compatible with asdf",
"type": "boolean"
},
"cargo_binstall": {
"description": "use cargo-binstall to install rust tools if available",
"type": "boolean",
"default": true
},
"color": {
"description": "colorize output",
"type": "boolean",
"default": true
},
"disable_default_shorthands": {
"description": "disables built-in shorthands",
"type": "boolean"
},
"disable_tools": {
"description": "tools that should not be used",
"items": {
"description": "tool name",
"type": "string"
},
"type": "array"
},
"experimental": {
"description": "enable experimental features",
"type": "boolean"
},
"jobs": {
"description": "number of tools to install in parallel, default is 4",
"type": "integer"
},
"legacy_version_file": {
"description": "should mise parse legacy version files (e.g. .node-version)",
"type": "boolean"
},
"legacy_version_file_disable_tools": {
"description": "tools that should not have their legacy version files parsed",
"items": {
"description": "tool name",
"type": "string"
},
"type": "array"
},
"node_compile": {
"description": "do not use precompiled binaries for node",
"type": "boolean"
},
"not_found_auto_install": {
"description": "adds a shell hook to `mise activate` and shims to automatically install tools when they need to be installed",
"type": "boolean",
"default": true
},
"paranoid": {
"description": "extra-security mode, see https://mise.jdx.dev/paranoid.html for details",
"type": "boolean"
},
"plugin_autoupdate_last_check_duration": {
"description": "how often to check for plugin updates",
"type": "string"
},
"type": "array"
},
"experimental": {
"description": "enable experimental features",
"type": "boolean"
},
"jobs": {
"description": "number of tools to install in parallel, default is 4",
"type": "integer"
},
"legacy_version_file": {
"description": "should mise parse legacy version files (e.g. .node-version)",
"type": "boolean"
},
"legacy_version_file_disable_tools": {
"description": "tools that should not have their legacy version files parsed",
"items": {
"description": "tool name",
"python_compile": {
"description": "do not use precompiled binaries for python",
"type": "boolean"
},
"python_venv_auto_create": {
"description": "automatically create a virtualenv for python tools",
"type": "boolean"
},
"raw": {
"description": "directly connect plugin scripts to stdin/stdout, implies --jobs=1",
"type": "boolean"
},
"shorthands_file": {
"description": "path to file containing shorthand mappings",
"type": "string"
},
"type": "array"
},
"node_compile": {
"description": "do not use precompiled binaries for node",
"type": "boolean"
},
"not_found_auto_install": {
"description": "adds a shell hook to `mise activate` and shims to automatically install tools when they need to be installed",
"type": "boolean",
"default": true
},
"paranoid": {
"description": "extra-security mode, see https://mise.jdx.dev/paranoid.html for details",
"type": "boolean"
},
"plugin_autoupdate_last_check_duration": {
"description": "how often to check for plugin updates",
"type": "string"
},
"python_compile": {
"description": "do not use precompiled binaries for python",
"type": "boolean"
},
"python_venv_auto_create": {
"description": "automatically create a virtualenv for python tools",
"type": "boolean"
},
"raw": {
"description": "directly connect plugin scripts to stdin/stdout, implies --jobs=1",
"type": "boolean"
},
"shorthands_file": {
"description": "path to file containing shorthand mappings",
"type": "string"
},
"task_output": {
"default": "prefix",
"description": "how to display task output",
"enum": ["prefix", "interleave"],
"type": "string"
},
"trusted_config_paths": {
"description": "config files with these prefixes will be trusted by default",
"items": {
"description": "a path to add to PATH",
"status": {
"description": "configure messages displayed when changing directories or executing tools",
"type": "object",
"additionalProperties": false,
"properties": {
"missing_tools": {
"description": "display warning when a tool is not installed",
"type": "boolean",
"default": true
},
"show_env": {
"description": "display configured mise environment variables",
"type": "boolean"
},
"show_tools": {
"description": "display active tools",
"type": "boolean"
}
}
},
"task_output": {
"default": "prefix",
"description": "how to display task output",
"enum": ["prefix", "interleave"],
"type": "string"
},
"type": "array"
},
"quiet": {
"description": "suppress all non-error output",
"type": "boolean"
},
"verbose": {
"description": "display extra output",
"type": "boolean"
},
"yes": {
"description": "assume yes for all prompts",
"type": "boolean"
"trusted_config_paths": {
"description": "config files with these prefixes will be trusted by default",
"items": {
"description": "a path to add to PATH",
"type": "string"
},
"type": "array"
},
"quiet": {
"description": "suppress all non-error output",
"type": "boolean"
},
"verbose": {
"description": "display extra output",
"type": "boolean"
},
"yes": {
"description": "assume yes for all prompts",
"type": "boolean"
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ pub trait ConfigFile: Debug + Send + Sync {
fn env_entries(&self) -> Vec<EnvDirective> {
Default::default()
}
fn env_paths(&self) -> Result<Vec<PathBuf>> {
Ok(Default::default())
}
fn tasks(&self) -> Vec<&Task> {
Default::default()
}
Expand Down
1 change: 1 addition & 0 deletions src/config/env_directive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl EnvResults {
for (directive, source) in input {
let config_root = source.parent().unwrap();
ctx.insert("config_root", config_root);
ctx.insert("env", &env);
let normalize_path = |s: String| {
let s = s.strip_prefix("./").unwrap_or(&s);
match s.strip_prefix("~/") {
Expand Down
6 changes: 3 additions & 3 deletions src/config/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ pub struct Settings {
pub legacy_version_file: bool,
#[config(env = "MISE_LEGACY_VERSION_FILE_DISABLE_TOOLS", default = [], parse_env = list_by_comma)]
pub legacy_version_file_disable_tools: BTreeSet<String>,
/// what level of status messages to display when entering directories
#[config(nested)]
pub status: SettingsStatus,
#[config(env = "MISE_NODE_COMPILE", default = false)]
pub node_compile: bool,
#[config(env = "MISE_NOT_FOUND_AUTO_INSTALL", default = true)]
Expand Down Expand Up @@ -82,6 +79,9 @@ pub struct Settings {
pub raw: bool,
#[config(env = "MISE_SHORTHANDS_FILE")]
pub shorthands_file: Option<PathBuf>,
/// what level of status messages to display when entering directories
#[config(nested)]
pub status: SettingsStatus,
#[config(env = "MISE_TASK_OUTPUT")]
pub task_output: Option<String>,
#[config(env = "MISE_TRUSTED_CONFIG_PATHS", default = [], parse_env = list_by_colon)]
Expand Down

0 comments on commit 577749b

Please sign in to comment.