feat: add custom formatter and linter for beancount
This commit is contained in:
@@ -37,6 +37,19 @@ return {
|
|||||||
|
|
||||||
-- SQL
|
-- SQL
|
||||||
sql = { 'sqlfluff' },
|
sql = { 'sqlfluff' },
|
||||||
|
|
||||||
|
-- Custom linters
|
||||||
|
-- Beancount
|
||||||
|
beancount = { 'beancount' },
|
||||||
|
}
|
||||||
|
|
||||||
|
lint.linters.beancount = {
|
||||||
|
cmd = 'bean-check',
|
||||||
|
stdin = false,
|
||||||
|
args = { '--' },
|
||||||
|
stream = 'stderr',
|
||||||
|
ignore_exitcode = true,
|
||||||
|
parser = require('lint.parser').from_errorformat('%f:%l: %m', { source = 'bean-check' }),
|
||||||
}
|
}
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ return {
|
|||||||
|
|
||||||
-- Web / Frontend
|
-- Web / Frontend
|
||||||
html = { 'prettier' },
|
html = { 'prettier' },
|
||||||
css = { 'prettier', 'stylelint' },
|
css = { 'prettier' },
|
||||||
javascript = { 'prettier', 'eslint_d' },
|
javascript = { 'prettier' },
|
||||||
php = { 'phpcbf' },
|
php = { 'phpcbf' },
|
||||||
|
|
||||||
-- YAML
|
-- YAML
|
||||||
@@ -44,6 +44,9 @@ return {
|
|||||||
|
|
||||||
-- SQL
|
-- SQL
|
||||||
sql = { 'sqlfluff' },
|
sql = { 'sqlfluff' },
|
||||||
|
|
||||||
|
-- Beancount
|
||||||
|
beancount = { 'bean_format' },
|
||||||
},
|
},
|
||||||
format_injected = true,
|
format_injected = true,
|
||||||
default_format_opts = {
|
default_format_opts = {
|
||||||
@@ -53,6 +56,13 @@ return {
|
|||||||
lsp_format = 'fallback',
|
lsp_format = 'fallback',
|
||||||
timeout_ms = 1000,
|
timeout_ms = 1000,
|
||||||
},
|
},
|
||||||
|
formatters = {
|
||||||
|
bean_format = {
|
||||||
|
command = 'bean-format',
|
||||||
|
args = { '-' },
|
||||||
|
stdin = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user