Skip to content

bug: yq formatter uses unexpected argument #828

@redbeardymcgee

Description

@redbeardymcgee

Neovim version (nvim -v)

nvim 0.11.5

Operating system/version

nixos 25.11

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

          2025-12-14 17:02:57[ERROR] Formatter 'yq' error: jq: Unknown option -P
          Use jq --help for help with command-line options,
          or see the jq manpage, or online docs  at https://jqlang.org

Describe the bug

The option -P does not exist in either yq or jq.

What is the severity of this bug?

blocking (cannot use plugin)

Steps To Reproduce

format a yaml file with yq.

Expected Behavior

File is formatted.

Minimal example file

## https://github.com/slskd/slskd/blob/master/config/slskd.example.yml

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

I cannot find any -P option in either yq or jq with their help or manpages. It's possible I've overlooked it somewhere, but that seems unlikely since the option is not documented anywhere. I'm not even sure what the option is meant to support, so I don't know if it's just a typo. -p (lower-case) also does not exist. Was this option deprecated or removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions