Autoformatting for django does 4-spaces now thank fucking god

This commit is contained in:
Jimmy Bates 2024-07-03 10:31:34 -07:00
parent 9838812715
commit 62847aca50
2 changed files with 10 additions and 2 deletions

View File

@ -27,13 +27,13 @@ return {
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
python = { 'autopep8' }, python = { 'autopep8' },
javascript = { { 'prettierd', 'prettier' } }, javascript = { 'prettier' },
c = { 'clang-format' }, c = { 'clang-format' },
cpp = { 'clang-format' }, cpp = { 'clang-format' },
yaml = { 'yamlfmt' }, yaml = { 'yamlfmt' },
html = { 'djlint' }, html = { 'djlint' },
htmldjango = { 'djlint' }, htmldjango = { 'djlint' },
css = { { 'prettierd', 'prettier' } }, css = { 'prettier' },
json = { 'deno_fmt' }, json = { 'deno_fmt' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" }, -- python = { "isort", "black" },
@ -42,5 +42,12 @@ return {
-- is found. -- is found.
-- javascript = { { "prettierd", "prettier" } }, -- javascript = { { "prettierd", "prettier" } },
}, },
formatters = {
djlint = {
args = function()
return { '-', '--reformat', '--profile', 'django', '--indent', 4 }
end,
},
},
}, },
} }

View File

@ -12,6 +12,7 @@ return {
javascript = { 'eslint' }, javascript = { 'eslint' },
css = { 'stylelint' }, css = { 'stylelint' },
html = { 'djlint' }, html = { 'djlint' },
htmldjango = { 'djlint' },
} }
-- To allow other plugins to add linters to require('lint').linters_by_ft, -- To allow other plugins to add linters to require('lint').linters_by_ft,