refactor: address emmylua diagnostics

This commit is contained in:
2026-04-20 22:11:18 +02:00
parent 516b9ea749
commit c7dd083083
29 changed files with 542 additions and 532 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ return {
"bash",
"zsh",
},
on_attach = function(client, bufnr)
on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>lf", function()
util.format({
buf = bufnr,
+1 -1
View File
@@ -12,7 +12,7 @@ return {
"--enable-config",
},
single_file_support = true,
on_attach = function(client, bufnr)
on_attach = function(_, bufnr)
Linter.add(bufnr, {
cmd = {
"clang-tidy",
+42 -12
View File
@@ -1,5 +1,3 @@
local lsp = require("lsp")
local lua_library_paths = { vim.env.VIMRUNTIME }
vim.list_extend(lua_library_paths, require("pack").get_paths())
@@ -7,17 +5,17 @@ vim.list_extend(lua_library_paths, require("pack").get_paths())
return {
settings = {
emmylua = {
format = {
useDiff = true,
externalTool = {
program = "luafmt",
args = {
"--stdin",
"--level=lua-jit",
"--config=.luafmt.toml",
}
diagnostics = {
disable = {
"unnecessary-if",
"preferred-local-alias",
"redefined-local",
},
},
format = {
-- Re-enable once luafmt is integrated in server
-- useDiff = true,
},
runtime = {
version = "LuaJIT",
requirePattern = {
@@ -33,5 +31,37 @@ return {
},
}
},
on_attach = lsp.on_attach,
on_attach = function(_, bufnr)
local util = require("util")
vim.keymap.set("n", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})
end, { buffer = bufnr })
vim.keymap.set("x", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--range-start",
"%byte_start%",
"--range-end",
"%byte_end%",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})
end, { buffer = bufnr })
end,
}
+1 -1
View File
@@ -11,7 +11,7 @@ return {
},
},
},
on_attach = function(client, bufnr)
on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>lf", function()
util.format({
buf = bufnr,
+1 -1
View File
@@ -11,7 +11,7 @@ return {
},
},
},
on_attach = function(client, bufnr)
on_attach = function(_, bufnr)
Linter.add(bufnr, {
cmd = {
"phpcs",
-73
View File
@@ -1,73 +0,0 @@
local lua_library_paths = { vim.env.VIMRUNTIME }
vim.list_extend(lua_library_paths, require("pack").get_paths())
---@type vim.lsp.Config
return {
settings = {
Lua = {
codeLens = {
enable = true,
},
completion = {
callSnippet = "Replace",
keywordSnippet = "Replace",
showWord = "Disable",
},
runtime = {
version = "LuaJIT",
path = {
"lua/?.lua",
"lua/?/init.lua",
},
pathStrict = true,
},
workspace = {
library = lua_library_paths,
checkThirdParty = false,
},
hint = {
enable = false,
arrayIndex = "Disable",
await = true,
paramName = "All",
paramType = true,
semicolon = "Disable",
setType = true,
},
telemetry = { enable = false },
},
},
on_attach = function(_, bufnr)
local util = require("util")
vim.keymap.set("n", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})
end, { buffer = bufnr })
vim.keymap.set("x", "<leader>lf", function()
util.format({
buf = bufnr,
cmd = {
"stylua",
"--range-start",
"%byte_start%",
"--range-end",
"%byte_end%",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})
end, { buffer = bufnr })
end,
}
+1 -1
View File
@@ -2,7 +2,7 @@ local util = require("util")
---@type vim.lsp.Config
return {
on_attach = function(client, bufnr)
on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>lf", function()
vim.lsp.buf.format()
util.format({