From 5c9192f13c16ab2b0e5af8bf75a5c14b5bf13700 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:03:05 -0600 Subject: [PATCH 1/2] fix(completions): set usage cache-key --- .mise.lock | 17 ----------------- .mise.toml | 2 +- Cargo.lock | 4 ++-- src/cli/completion.rs | 4 +++- 4 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 .mise.lock diff --git a/.mise.lock b/.mise.lock deleted file mode 100644 index aede0f7aa2..0000000000 --- a/.mise.lock +++ /dev/null @@ -1,17 +0,0 @@ -[tools] -actionlint = "1.7.4" -cargo-binstall = "1.10.10" -"cargo:cargo-edit" = "0.13.0" -"cargo:cargo-insta" = "1.41.1" -"cargo:cargo-show" = "0.6.0" -"cargo:git-cliff" = "2.6.1" -"cargo:usage-cli" = "1.1.1" -direnv = "latest" -jq = "1.7.1" -"npm:markdownlint-cli" = "0.42.0" -"npm:prettier" = "3.3.3" -"pipx:toml-sort" = "0.23.1" -python = "3.13.0" -ripgrep = "14.1.1" -shellcheck = "0.10.0" -shfmt = "3.10.0" diff --git a/.mise.toml b/.mise.toml index d618a13df9..100e1ac43a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -25,7 +25,7 @@ direnv = "latest" actionlint = "latest" ripgrep = "latest" "pipx:toml-sort" = "latest" -"cargo:usage-cli" = "1" +"cargo:usage-cli" = "1.2" #python = { version = "latest", virtualenv = "{{env.HOME}}/.cache/venv" } #ruby = "3.1" diff --git a/Cargo.lock b/Cargo.lock index e8982f0b72..f721372850 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3992,9 +3992,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "usage-lib" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90003cbecbddb5a8213c949ce0d0d3f75b6d445159703feaebfd36ba5fa8ac9" +checksum = "c80a6a75819b2e997666722dc47342c1890af0a68b823104153be23ac0b43c94" dependencies = [ "clap", "heck 0.5.0", diff --git a/src/cli/completion.rs b/src/cli/completion.rs index 9e120c9b5f..7701abc061 100644 --- a/src/cli/completion.rs +++ b/src/cli/completion.rs @@ -50,7 +50,9 @@ impl Completion { shell.to_string(), "mise", "--usage-cmd", - "mise usage" + "mise usage", + "--cache-key", + env!("CARGO_PKG_VERSION") ) .read() } From 623932d1fedd076b883cb6ae97286a7ac443afe4 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 23:43:49 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- completions/_mise | 6 +++--- completions/mise.bash | 6 +++--- completions/mise.fish | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/completions/_mise b/completions/_mise index c4ada2abea..dd769a714c 100644 --- a/completions/_mise +++ b/completions/_mise @@ -27,11 +27,11 @@ _mise() { zstyle ":completion:${curcontext}:" cache-policy _usage_mise_cache_policy fi - if ( [[ -z "${_usage_mise_spec:-}" ]] || _cache_invalid _usage_mise_spec ) \ - && ! _retrieve_cache _usage_mise_spec; + if ( [[ -z "${_usage_spec_mise_2024_11_1:-}" ]] || _cache_invalid _usage_spec_mise_2024_11_1 ) \ + && ! _retrieve_cache _usage_spec_mise_2024_11_1; then spec="$(mise usage)" - _store_cache _usage_mise_spec spec + _store_cache _usage_spec_mise_2024_11_1 spec fi _arguments "*: :(($(usage complete-word --shell zsh -s "$spec" -- "${words[@]}" )))" diff --git a/completions/mise.bash b/completions/mise.bash index c173c8fcd0..29b57d4aaf 100644 --- a/completions/mise.bash +++ b/completions/mise.bash @@ -6,11 +6,11 @@ _mise() { return 1 fi - if [[ -z ${_USAGE_SPEC_MISE:-} ]]; then - _USAGE_SPEC_MISE="$(mise usage)" + if [[ -z ${_usage_spec_mise_2024_11_1:-} ]]; then + _usage_spec_mise_2024_11_1="$(mise usage)" fi - COMPREPLY=( $(usage complete-word --shell bash -s "${_USAGE_SPEC_MISE}" --cword="$COMP_CWORD" -- "${COMP_WORDS[@]}" ) ) + COMPREPLY=( $(usage complete-word --shell bash -s "${_usage_spec_mise_2024_11_1}" --cword="$COMP_CWORD" -- "${COMP_WORDS[@]}" ) ) if [[ $? -ne 0 ]]; then unset COMPREPLY fi diff --git a/completions/mise.fish b/completions/mise.fish index 1b9d2fc6f4..44931ef022 100644 --- a/completions/mise.fish +++ b/completions/mise.fish @@ -6,5 +6,7 @@ if ! command -v usage &> /dev/null return 1 end -set _usage_spec_mise (mise usage | string collect) -complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise" -- (commandline -cop) (commandline -t))' +if ! set -q _usage_spec_mise_2024_11_1 + set -U _usage_spec_mise_2024_11_1 (mise usage | string collect) +end +complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2024_11_1" -- (commandline -cop) (commandline -t))'