chore: run lint and fix errors

This commit is contained in:
2026-03-25 15:52:53 +05:00
parent 5ccf595db2
commit 4db280c102
10 changed files with 78 additions and 77 deletions

View File

@@ -57,7 +57,7 @@ for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
end
-- add binaries installed by mason.nvim to path
local is_windows = vim.fn.has("win32") ~= 0
local is_windows = vim.fn.has "win32" ~= 0
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
-------------------------------------- autocmds ------------------------------------------
@@ -112,7 +112,7 @@ vim.api.nvim_create_autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),
callback = function(args)
local file = vim.api.nvim_buf_get_name(args.buf)
local buftype = vim.api.nvim_buf_get_option(args.buf, "buftype")
local buftype = vim.bo[args.buf].buftype
if not vim.g.ui_entered and args.event == "UIEnter" then
vim.g.ui_entered = true
@@ -123,12 +123,10 @@ vim.api.nvim_create_autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
vim.api.nvim_del_augroup_by_name "NvFilePost"
vim.schedule(function()
vim.api.nvim_exec_autocmds("FileType", {})
if vim.g.editorconfig then
require("editorconfig").config(args.buf)
end
end, 0)
end)
end
end,
})

View File

@@ -202,14 +202,14 @@ M.lspconfig = {
["[d"] = {
function()
vim.diagnostic.goto_prev { float = { border = "rounded" } }
vim.diagnostic.jump { count = -1, float = { border = "rounded" } }
end,
"Goto prev",
},
["]d"] = {
function()
vim.diagnostic.goto_next { float = { border = "rounded" } }
vim.diagnostic.jump { float = { border = "rounded" } }
end,
"Goto next",
},

View File

@@ -106,7 +106,7 @@ M.lazy_load = function(plugin)
if plugin == "nvim-lspconfig" then
vim.cmd "silent! do FileType"
end
end, 0)
end)
else
require("lazy").load { plugins = plugin }
end

View File

@@ -1,9 +1,9 @@
---@type ChadrcConfig
local M = {}
M.ui = { theme = 'catppuccin' }
M.ui = { theme = "catppuccin" }
M.mappings = require('custom.mappings')
M.plugins = 'custom.plugins'
M.mappings = require "custom.mappings"
M.plugins = "custom.plugins"
return M

View File

@@ -1,4 +1,4 @@
local dap = require("dap")
local dap = require "dap"
dap.adapters["pwa-node"] = {
type = "server",

View File

@@ -1,4 +1,4 @@
local config = require("plugins.configs.lspconfig")
local config = require "plugins.configs.lspconfig"
local on_attach = config.on_attach
local capabilities = config.capabilities
@@ -11,7 +11,7 @@ local custom_on_attach = function(client, bufnr)
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
}
vim.lsp.buf.execute_command(params)
client:request("workspace/executeCommand", params)
end, { desc = "Organize Imports" })
end
end
@@ -22,22 +22,22 @@ vim.lsp.config("ts_ls", {
init_options = {
preferences = {
disablesuggestions = true,
}
},
},
})
vim.lsp.enable("ts_ls")
vim.lsp.enable "ts_ls"
vim.lsp.config("terraformls", {
on_attach = on_attach,
capabilities = capabilities,
})
vim.lsp.enable("terraformls")
vim.lsp.enable "terraformls"
vim.lsp.config("tflint", {
on_attach = on_attach,
capabilities = capabilities,
})
vim.lsp.enable("tflint")
vim.lsp.enable "tflint"
vim.lsp.config("gopls", {
on_attach = on_attach,
@@ -55,14 +55,14 @@ vim.lsp.config("gopls", {
},
},
})
vim.lsp.enable("gopls")
vim.lsp.enable "gopls"
vim.lsp.config("pyright", {
on_attach = on_attach,
capabilities = capabilities,
filetypes = { "python" },
})
vim.lsp.enable("pyright")
vim.lsp.enable "pyright"
vim.lsp.config("nil_ls", {
on_attach = on_attach,
@@ -70,7 +70,7 @@ vim.lsp.config("nil_ls", {
cmd = { "nil" },
filetypes = { "nix" },
settings = {
['nil'] = {
["nil"] = {
testSetting = 42,
formatting = {
command = { "nixfmt" },
@@ -78,4 +78,4 @@ vim.lsp.config("nil_ls", {
},
},
})
vim.lsp.enable("nil_ls")
vim.lsp.enable "nil_ls"

View File

@@ -1,7 +1,12 @@
vim.g.maplocalleader = ","
vim.opt.colorcolumn = "80"
vim.g.copilot_no_tab_map = true
vim.api.nvim_set_keymap("i", "<C-o>", 'copilot#Accept("<CR>")', { silent = true, expr = true, noremap = true, script = true })
vim.api.nvim_set_keymap(
"i",
"<C-o>",
'copilot#Accept("<CR>")',
{ silent = true, expr = true, noremap = true, script = true }
)
vim.wo.relativenumber = true
vim.opt.scrolloff = 8
@@ -12,7 +17,7 @@ vim.opt.autoread = true
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter" }, {
pattern = "*",
callback = function()
vim.cmd("checktime")
vim.cmd "checktime"
end,
})

View File

@@ -8,7 +8,7 @@ M.disabled = {
},
}
M['rust-tools'] = {
M["rust-tools"] = {
n = {
["<C-space>"] = {
function()
@@ -39,7 +39,7 @@ M.dap = {
"<cmd> DapTerminate <CR>",
"Close Debugger",
},
}
},
}
M.dap_python = {
@@ -52,7 +52,7 @@ M.dap_python = {
end,
"Debug test method",
},
}
},
}
M.lazygit = {
@@ -102,14 +102,14 @@ M.worktree = {
n = {
["<leader>gwv"] = {
function()
local telescope = require("telescope")
local telescope = require "telescope"
telescope.extensions.git_worktree.git_worktrees()
end,
"View Git Worktrees",
},
["<leader>gwn"] = {
function()
local telescope = require("telescope")
local telescope = require "telescope"
telescope.extensions.git_worktree.create_git_worktree()
end,
"New Git Worktree",
@@ -136,7 +136,7 @@ M.trouble = {
"<cmd> Trouble diagnostics toggle <CR>",
"Diagnostics (Trouble)",
},
}
},
}
M.tabufline = {

View File

@@ -16,7 +16,7 @@ local plugins = {
config = function(_, _)
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
require("dap-python").setup(path)
end
end,
},
{
"rcarriga/nvim-dap-ui",
@@ -24,8 +24,8 @@ local plugins = {
"mfussenegger/nvim-dap",
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
local dap = require "dap"
local dapui = require "dapui"
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
@@ -43,7 +43,7 @@ local plugins = {
{
"nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("git_worktree")
require("telescope").load_extension "git_worktree"
end,
},
{
@@ -140,8 +140,8 @@ local plugins = {
{
"neovim/nvim-lspconfig",
config = function()
require("plugins.configs.lspconfig")
require("custom.configs.lspconfig")
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
{
@@ -160,7 +160,7 @@ local plugins = {
ft = "rust",
dependencies = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim", "mfussenegger/nvim-dap" },
opts = function()
local lspconfig = require("plugins.configs.lspconfig")
local lspconfig = require "plugins.configs.lspconfig"
-- local extension_path = vim.env.HOME .. "/.local/share/nvim/mason/packages/codelldb/extension/"
-- local codelldb_path = extension_path .. 'adapter/codelldb'
-- local liblldb_path = extension_path .. 'lldb/lib/liblldb.so'
@@ -202,13 +202,13 @@ local plugins = {
"saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
config = function(_, opts)
local crates = require("crates")
local crates = require "crates"
crates.setup(opts)
cmp.setup.buffer({
sources = { { name = "crates" }}
})
cmp.setup.buffer {
sources = { { name = "crates" } },
}
crates.show()
require("core.utils").load_mappings("crates")
require("core.utils").load_mappings "crates"
end,
},
{
@@ -228,14 +228,14 @@ local plugins = {
"mhartington/formatter.nvim",
event = "VeryLazy",
opts = function()
return require("custom.configs.formatter")
end
return require "custom.configs.formatter"
end,
},
{
"laytan/cloak.nvim",
lazy = false,
config = function()
require("cloak").setup({
require("cloak").setup {
enabled = true,
cloak_character = "*",
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
@@ -252,23 +252,21 @@ local plugins = {
-- Match an equals sign and any character after it.
-- This can also be a table of patterns to cloak,
-- example: cloak_pattern = { ":.+", "-.+" } for yaml files.
cloak_pattern = "=.+"
cloak_pattern = "=.+",
},
},
})
}
end,
},
{
"yetone/avante.nvim",
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
-- ⚠️ must add this setting! ! !
build = vim.fn.has("win32") ~= 0
and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
build = vim.fn.has "win32" ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make",
event = "VeryLazy",
version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = {
-- add any opts here
-- this file can contain specific instructions for your project
@@ -327,7 +325,7 @@ local plugins = {
},
{
-- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim',
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},

View File

@@ -62,6 +62,6 @@ vim.lsp.config("lua_ls", {
},
},
})
vim.lsp.enable("lua_ls")
vim.lsp.enable "lua_ls"
return M