mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.89k stars 198 forks source link

HELP: is ansible-lint working? #618

Closed eb0687 closed 2 months ago

eb0687 commented 2 months ago

I have just installed this plugin and linting seems to work for other languages except for ansible, below is my config:

return {
    "mfussenegger/nvim-lint",
    event = { "BufReadPre", "BufNewFile" },
    config = function()
        local lint = require("lint")
        lint.linters_by_ft = {
            -- ["yaml.ansible"] = { "ansible_lint" },
            ansible = { "ansible_lint" },
            bash = { "shellcheck" },
            python = { "pylint" },
            html = { "markuplint" },
        }

        local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

        vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
            group = lint_augroup,
            callback = function()
                lint.try_lint()
            end,
        })
        vim.keymap.set("n", "<leader>l", function()
            lint.try_lint()
        end, { desc = "Trigger linting for current file" })
    end,
}

been at this for hours now and cant seem to get linting to work and out of ideas, any guidance would be appreciated.

eb0687 commented 2 months ago

nevermind its working now, not sure what I did exactly.....