enc: migrate to auto-lint and auto-conform

This commit is contained in:
asep.komarudin 2024-07-05 07:59:12 +07:00
parent eace6b6674
commit ff62c20795
11 changed files with 38 additions and 55 deletions

View file

@ -173,7 +173,7 @@ pcode.active_golang_config = false
pcode.active_python_config = false
pcode.active_cpp_config = false
pcode.active_java_config = {
active = true,
active = false,
project = "gradle", -- gradle or maven
use_nvim_jdtls = true, -- mfussenegger/nvim-jdtls
}

View file

@ -10,27 +10,15 @@ if disable then
"mfussenegger/nvim-lint",
},
event = "VeryLazy",
config = function()
require("auto-lint").setup({
map_lang = {
-- ["c++"] = "cpp",
-- ["c#"] = "cs",
},
map_name = {
-- ["actionlint"] = "actionlint",
-- ["ansible_lint"] = "ansible_lint",
},
add_new = {
-- ["typescriptreact"] = { "eslint_d" },
-- ["javascriptreact"] = { "eslint_d" },
},
ignore = {
-- ["php"] = { "tlint" },
},
ensure_installed = {
-- "eslint_d",
},
})
opts = function(_, opts)
opts.map_lang = opts.map_lang or {}
opts.map_name = opts.map_name or {}
opts.add_new = opts.add_new or {}
opts.ignore = opts.ignore or {}
opts.ensure_installed = opts.ensure_installed or {}
end,
config = function(_, opts)
require("auto-lint").setup(opts)
end,
}
end

View file

@ -28,11 +28,11 @@ if pcode.active_cpp_config then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "clang-format"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.cpp = { package }
opts.formatters_by_ft.c = { package }
end,

View file

@ -16,20 +16,20 @@ if pcode.active_deno_config or false then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "prettier"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.javascript = { package }
end,
},
{
"mfussenegger/nvim-lint",
"pojokcodeid/auto-lint.nvim",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
require("user.utils.masoncfg").try_install("eslint_d")
vim.list_extend(opts.ensure_installed, { "eslint_d" })
opts.linters_by_ft.javascript = { "eslint_d" }
end,
},

View file

@ -18,19 +18,19 @@ if pcode.active_golang_config then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "gofumpt"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.python = { package }
end,
},
{
"mfussenegger/nvim-lint",
"pojokcodeid/auto-lint.nvim",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
require("user.utils.masoncfg").try_install("ast-grep")
vim.list_extend(opts.ensure_installed, { "ast-grep" })
opts.linters_by_ft.php = { "ast-grep" }
end,
},

View file

@ -17,12 +17,12 @@ if pcode.active_javascript_config.active then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "prettier"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.javascript = { package }
end,
},

View file

@ -17,21 +17,21 @@ if pcode.active_kotlin_config or false then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "ktfmt"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.kotlin = { package }
end,
},
{
"mfussenegger/nvim-lint",
"pojokcodeid/auto-lint.nvim",
optional = true,
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
require("user.utils.masoncfg").try_install("ktlint")
vim.list_extend(opts.ensure_installed, { "ktlint" })
opts.linters_by_ft.kotlin = { "ktlint" }
end,
},

View file

@ -16,12 +16,10 @@ if pcode.active_php_config then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "php-cs-fixer"
require("user.utils.masoncfg").try_install(package)
require("user.utils.masoncfg").try_install("blade-formatter")
vim.list_extend(opts.ensure_installed, { "php-cs-fixer", "blade-formatter" })
opts.formatters_by_ft.php = { "easy-coding-standard" }
opts.formatters_by_ft.blade = { "blade-formatter" }
end,

View file

@ -117,14 +117,11 @@ if pcode.active_python_config then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "black"
require("user.utils.masoncfg").try_install("flake8")
require("user.utils.masoncfg").try_install("black")
require("user.utils.masoncfg").try_install("debugpy")
opts.formatters_by_ft.python = { package }
vim.list_extend(opts.ensure_installed, { "flake8", "black", "debugpy" })
opts.formatters_by_ft.python = { "black" }
end,
},
}

View file

@ -18,11 +18,11 @@ if pcode.active_rust_config then
end,
},
{
"stevearc/conform.nvim",
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "ast-grep"
require("user.utils.masoncfg").try_install(package)
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.rust = { package }
end,
},