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

jq required for completion #3805

Closed
eitamal opened this issue Dec 24, 2024 · 1 comment · Fixed by #3902
Closed

jq required for completion #3805

eitamal opened this issue Dec 24, 2024 · 1 comment · Fixed by #3902
Labels

Comments

@eitamal
Copy link
Contributor

eitamal commented Dec 24, 2024

Describe the bug
The change in #3497, adding descriptions to task completion, introduced a new requirement for jq, making all completions fail for people who don't have jq or have a different name for it — regardless of whether or not you use tasks.

To Reproduce
Type mise[space][tab]


Error: xx::process (link)

  × exited with code 127
  │ sh -c
  │ mise tasks --json | jq -r '.[] | (.name | sub(":"; "\\:")) + ":" + (.description | sub(":"; "\\:"))'

Expected behavior
Completions should be shown.

mise doctor output

version: 2024.12.19 linux-x64 (82840ee 2024-12-23)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 23 Dec 2024 19:10:54 +0000
  Rust Version: rustc 1.83.0 (90b35a623 2024-11-26)
  Profile: release

shell:
  fish
  fish, version 3.7.1

dirs:
  cache: ~/.cache/mise
  config: ~/.config/mise
  data: ~/.local/share/mise
  shims: ~/.local/share/mise/shims
  state: ~/.local/state/mise

config_files:
  ~/.config/mise/config.toml
  /tmp/tmp.IX1Ls6aOYT/mise.toml

ignored_config_files: (none)

backends:
  aqua
  asdf
  cargo
  core
  dotnet
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  dotnet  https://github.com/hensou/asdf-dotnet#888fdde
  lua     https://github.com/Stratus3D/asdf-lua.git#e0c15ea
  usage   https://github.com/jdx/mise-usage.git#fe3888a
  yt-dlp  https://github.com/duhow/asdf-yt-dlp.git#152effb

toolset:
  aqua:BurntSushi/ripgrep@14.1.1
  aqua:JohnnyMorganz/StyLua@2.0.2
  aqua:astral-sh/ruff@0.8.3
  aqua:astral-sh/uv@0.5.10
  aqua:cargo-bins/cargo-binstall@1.10.17
  aqua:charmbracelet/glow@2.0.0
  aqua:cli/cli@2.63.2
  aqua:fastfetch-cli/fastfetch@2.32.0
  aqua:itchyny/gojq@0.12.17
  aqua:junegunn/fzf@0.57.0
  aqua:koalaman/shellcheck@0.10.0
  aqua:mvdan/sh@3.10.0
  aqua:tree-sitter/tree-sitter@0.24.5
  asdf:dotnet@8.0.404
  asdf:dotnet@9.0.101
  asdf:lua@5.1.5
  asdf:richin13/asdf-neovim@nightly
  asdf:usage@1.7.4
  asdf:yt-dlp@2024.12.13
  core:bun@1.1.39
  core:deno@2.1.4
  core:go@1.23.4
  core:node@23.4.0
  core:python@3.13.1
  go:github.com/bootdotdev/bootdev@1.11.1
  npm:@biomejs/biome@1.9.4
  npm:neovim@5.3.0
  npm:typescript-language-server@4.3.3
  pipx:basedpyright@1.23.0
  pipx:csvkit@2.0.1
  pipx:pytest@8.3.4
  ubi:aquaproj/aqua@2.40.0-0
  ubi:casey/just@1.38.0
  ubi:dandavison/delta@0.18.2
  ubi:ducaale/xh@0.23.0
  ubi:eza-community/eza@0.20.12
  ubi:mikefarah/yq@4.44.6
  ubi:mvdan/gofumpt@0.7.0
  ubi:sharkdp/bat@0.24.0
  ubi:sharkdp/fd@10.2.0
  ubi:sharkdp/hyperfine@1.19.0
  ubi:sharkdp/numbat@1.14.0
  ubi:sharkdp/vivid@0.10.1
  ubi:tamasfe/taplo[matching=full]@0.9.3
  ubi:watchexec/watchexec[matching=musl]@2.2.1

path:
  ~/.local/share/mise/installs/usage/1.7.4/bin
  ~/.local/share/mise/installs/glow/2.0.0/glow_2.0.0_Linux_x86_64
  ~/.local/share/mise/installs/delta/0.18.2/bin
  ~/.local/share/mise/installs/xh/0.23.0/bin
  ~/.local/share/mise/installs/yq/4.44.6/bin
  ~/.local/share/mise/installs/bat/0.24.0/bin
  ~/.local/share/mise/installs/fd/10.2.0/bin
  ~/.local/share/mise/installs/hyperfine/1.19.0/bin
  ~/.local/share/mise/installs/just/1.38.0/bin
  ~/.local/share/mise/installs/fzf/0.57.0
  ~/.local/share/mise/installs/ripgrep/14.1.1/ripgrep-14.1.1-x86_64-unknown-linux-musl
  ~/.local/share/mise/installs/taplo/0.9.3/bin
  ~/.local/share/mise/installs/gojq/0.12.17/gojq_v0.12.17_linux_amd64
  ~/.local/share/mise/installs/vivid/0.10.1/bin
  ~/.local/share/mise/installs/github-cli/2.63.2/gh_2.63.2_linux_amd64/bin
  ~/.local/share/mise/installs/stylua/2.0.2
  ~/.local/share/mise/installs/watchexec/2.2.1/bin
  ~/.local/share/mise/installs/eza/0.20.12/bin
  ~/.local/share/mise/installs/numbat/1.14.0/bin
  ~/.local/share/mise/installs/csvkit/2.0.1/bin
  ~/.local/share/mise/installs/yt-dlp/2024.12.13/bin
  ~/.local/share/mise/installs/aqua/2.40.0-0/bin
  ~/.local/share/mise/installs/bootdev/1.11.1/bin
  ~/.local/share/mise/installs/tree-sitter/0.24.5
  ~/.local/share/mise/installs/shellcheck/0.10.0/shellcheck-v0.10.0
  ~/.local/share/mise/installs/shfmt/3.10.0
  ~/.local/share/mise/installs/aqua-fastfetch-cli-fastfetch/2.32.0/fastfetch-linux-amd64/usr/bin
  ~/.local/share/mise/installs/neovim/nightly/bin
  ~/.local/share/mise/installs/lua/5.1.5/bin
  ~/.local/share/mise/installs/lua/5.1.5/luarocks/bin
  ~/.local/share/mise/installs/neovim-node-host/5.3.0/bin
  ~/.local/share/mise/installs/python/3.13.1/bin
  ~/.local/share/mise/installs/uv/0.5.10/uv-x86_64-unknown-linux-musl
  ~/.local/share/mise/installs/pytest/8.3.4/bin
  ~/.local/share/mise/installs/ruff/0.8.3/ruff-x86_64-unknown-linux-musl
  ~/.local/share/mise/installs/basedpyright/1.23.0/bin
  ~/.local/share/mise/installs/dotnet/9.0.101/
  ~/.local/share/mise/installs/dotnet/9.0.101/shared
  ~/.local/share/mise/installs/dotnet/8.0.404/
  ~/.local/share/mise/installs/dotnet/8.0.404/shared
  ~/.local/share/mise/installs/deno/2.1.4/bin
  ~/.local/share/mise/installs/deno/2.1.4/.deno/bin
  ~/.local/share/mise/installs/node/23.4.0/bin
  ~/.local/share/mise/installs/bun/1.1.39/bin
  ~/.local/share/mise/installs/biome/1.9.4/bin
  ~/.local/share/mise/installs/ts-ls/4.3.3/bin
  ~/.local/share/mise/installs/go/1.23.4/bin
  ~/.local/share/mise/installs/gofumpt/0.7.0/bin
  ~/.local/share/mise/installs/cargo-binstall/1.10.17
  /nix/var/nix/profiles/default/bin
  ~/.local/share/aquaproj-aqua/bin
  /mnt/c/Windows
  /mnt/c/Windows/system32
  /mnt/c/Program Files (x86)/GnuWin32/bin
  /mnt/c/Program Files/Docker/Docker/resources/bin
  /mnt/c/Program Files/PowerShell/7
  /mnt/c/Windows/System32/OpenSSH
  /mnt/c/Windows/System32/Wbem
  /mnt/c/Windows/System32/WindowsPowerShell/v1.0
  /home/linuxbrew/.linuxbrew/bin
  /home/linuxbrew/.linuxbrew/sbin
  ~/.local/bin
  ~/.cargo/bin
  /usr/local/sbin
  /usr/local/bin
  /usr/sbin
  /usr/bin
  /sbin
  /bin
  /usr/games
  /usr/local/games
  /usr/lib/wsl/lib

env_vars:
  MISE_SHELL=fish
  MISE_NODE_DEFAULT_PACKAGES_FILE=~/.config/mise/default-pkgs/.node

settings:
  experimental                  true                                            ~/.config/mise/config.toml
  npm.bun                       true                                            ~/.config/mise/config.toml
  pipx.uvx                      true                                            ~/.config/mise/config.toml
  python.default_packages_file  "~/.config/mise/default-pkgs/.python" ~/.config/mise/config.toml

No problems found

Additional context
I've replicated the string substitution and formatting using sed instead, which solved my issue:

mise tasks --no-header | sed -e 's/:/\\:/g' -e 's/^\(\S\+\)\s*\(.*\)$/\1:\2/'

I'm happy to update the usage files with this fix and open a PR, but I'd completely understand if you decide to stick with jq (it is pretty awesome and regexes kinda suck 😅 ).

@eitamal eitamal added the bug label Dec 24, 2024
@jdx
Copy link
Owner

jdx commented Dec 26, 2024

I could go either way. It’d be nice to not need jq but with sed regressions are a lot more likely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants