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

Adding support for erb-lint by Shopify #191

Open
weizheheng opened this issue Nov 30, 2021 · 1 comment
Open

Adding support for erb-lint by Shopify #191

weizheheng opened this issue Nov 30, 2021 · 1 comment

Comments

@weizheheng
Copy link
Contributor

Name: erb-lint
URL: https://github.com/Shopify/erb-lint

There is this issue open on the Ale's repository. I am curious is this possible to add this here?

I was trying around and thought I might be able to change the lintingCommand and formatCommand to get it work. But I am not really sure what that two commands are expecting. Would love some input on whether this integration is possible.

@adamyonk
Copy link

adamyonk commented Apr 22, 2024

This gets close, I'm still having some weirdness with erblint writing random configs to disk with this setup, still looking into that.

local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local erblint = {
    lintCommand = "erblint --format compact --stdin ${INPUT}",
    lintStdin = true,
    lintFormats = {
      "%f:%l:%c: %m",
    },
    lintIgnoreExitCode = true,
    formatCommand = "erblint --autocorrect --stdin ${INPUT} | tail -n +5",
    formatStdin = true,
}
lspconfig.efm.setup {
    capabilities = capabilities,
    init_options = { documentFormatting = true },
    settings = {
        rootMarkers = {".git/"},
        languages = {
            eruby = {erblint},
        }
    },
    filetypes = {
        "eruby",
    }
}

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

No branches or pull requests

2 participants