LazyVim / LazyVim

Neovim config for the lazy
https://lazyvim.github.io/
Apache License 2.0
17.22k stars 1.21k forks source link

bug: Adding prepend_args to markdowncli2 causes markdownlint-cli2 to not load #4695

Closed shauryagoel closed 19 hours ago

shauryagoel commented 1 day ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.2

Operating system/version

MacOS 11.6.1

Describe the bug

I want to disable long line length warning in markdown files. To solve this, I updated this config-

{
    "mfussenegger/nvim-lint",
    optional = true,
    opts = {
      linters_by_ft = {
        markdown = { "markdownlint-cli2" },
      },
      linters = {
        ["markdownlint-cli2"] = {
          prepend_args = {
            -- Disable long line length warning
            "--config",
            "~/.config/nvim/.markdownlint-cli2.yaml",
          },
        },
      },
    },
  }

.markdownlint-cli2.yaml-

---
config:
  line-length: false  # Disable MD013 lint for line length

However, when I open a markdown file, no other diagnostics are being shown. On using :ConformInfo, I see markdownlint-cli2 unavailable: Condition failed. However, if I use markdownlint-cli2 in the terminal and pass in the yaml config file, everything works as expected.

Steps To Reproduce

  1. Use the above neovim config and markdownlint-cli2 config yaml in ~/.config/nvim/.markdownlint-cli2.yaml.
  2. Start a markdown file and type :ConformInfo.

Expected Behavior

Other diagnostics besides the line length are displayed in neovim markdown buffer. Also, :ConformInfo shows that markdownlint-cli2 is found.

Repro

No response

dpetka2001 commented 1 day ago

I have the following and it seems to be working correctly

  {
    "mfussenegger/nvim-lint",
    opts = {
      linters = {
        ["markdownlint-cli2"] = {
          prepend_args = { "--config", "/home/jrn23/.config/LazyVimDev/.markdownlint-cli2.yaml", "--" },
        },
      },
    },
  },
shauryagoel commented 19 hours ago

The config by @dpetka2001 works as expected. I think there might be some issue with my config. Sorry for creating noise.