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,16 +8,16 @@ M.disabled = {
},
}
M['rust-tools'] = {
M["rust-tools"] = {
n = {
["<C-space>"] = {
function ()
function()
require("rust-tools.hover_actions").hover_actions()
end,
"Rust hover actions",
},
["<leader>a"] = {
function ()
function()
require("rust-tools.code_action_group").code_action_group()
end,
"Rust code action group",
@@ -39,7 +39,7 @@ M.dap = {
"<cmd> DapTerminate <CR>",
"Close Debugger",
},
}
},
}
M.dap_python = {
@@ -47,12 +47,12 @@ M.dap_python = {
n = {
["<leader>dpr"] = {
function ()
function()
require("dap-python").test_method()
end,
"Debug test method",
},
}
},
}
M.lazygit = {
@@ -83,7 +83,7 @@ M.noice = {
"<cmd> Noice last <CR>",
"Show last message",
},
["<leader>nt"] ={
["<leader>nt"] = {
"<cmd> Noice telescope <CR>",
"Noice telescope mode",
},
@@ -101,15 +101,15 @@ M.noice = {
M.worktree = {
n = {
["<leader>gwv"] = {
function ()
local telescope = require("telescope")
function()
local telescope = require "telescope"
telescope.extensions.git_worktree.git_worktrees()
end,
"View Git Worktrees",
},
["<leader>gwn"] = {
function ()
local telescope = require("telescope")
function()
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

@@ -13,19 +13,19 @@ local plugins = {
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
},
config = function (_, _)
config = function(_, _)
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
require("dap-python").setup(path)
end
end,
},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
},
config = function ()
local dap = require("dap")
local dapui = require("dapui")
config = function()
local dap = require "dap"
local dapui = require "dapui"
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
@@ -42,8 +42,8 @@ local plugins = {
{ "folke/neodev.nvim", opts = {} },
{
"nvim-telescope/telescope.nvim",
config = function ()
require("telescope").load_extension("git_worktree")
config = function()
require("telescope").load_extension "git_worktree"
end,
},
{
@@ -77,7 +77,7 @@ local plugins = {
enabled = false,
},
},
config = function (_, opts)
config = function(_, opts)
require("noice").setup(opts)
end,
dependencies = {
@@ -139,9 +139,9 @@ local plugins = {
},
{
"neovim/nvim-lspconfig",
config = function ()
require("plugins.configs.lspconfig")
require("custom.configs.lspconfig")
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
{
@@ -151,7 +151,7 @@ local plugins = {
{
"rust-lang/rust.vim",
ft = "rust",
init =function ()
init = function()
vim.g.rustfmt_autosave = 1
end,
},
@@ -159,8 +159,8 @@ local plugins = {
"simrat39/rust-tools.nvim",
ft = "rust",
dependencies = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim", "mfussenegger/nvim-dap" },
opts = function ()
local lspconfig = require("plugins.configs.lspconfig")
opts = function()
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'
@@ -193,7 +193,7 @@ local plugins = {
},
{
"crnvl96/lazydocker.nvim",
opts = {}, -- automatically calls `require("lazydocker").setup()`
opts = {}, -- automatically calls `require("lazydocker").setup()`
dependencies = {
"MunifTanjim/nui.nvim",
},
@@ -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,
},
{
@@ -220,22 +220,22 @@ local plugins = {
behavior = cmp.ConfirmBehavior.Insert,
select = false,
}
table.insert(M.sources, {name = "crates"})
table.insert(M.sources, { name = "crates" })
return M
end,
},
{
"mhartington/formatter.nvim",
event = "VeryLazy",
opts = function ()
return require("custom.configs.formatter")
end
opts = function()
return require "custom.configs.formatter"
end,
},
{
"laytan/cloak.nvim",
lazy = false,
config = function ()
require("cloak").setup({
config = function()
require("cloak").setup {
enabled = true,
cloak_character = "*",
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
@@ -245,30 +245,28 @@ local plugins = {
-- Match any file starting with ".env".
-- This can be a table to match multiple file patterns.
file_pattern = {
".env*",
"wrangler.toml",
".dev.vars",
".env*",
"wrangler.toml",
".dev.vars",
},
-- 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"
or "make",
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
@@ -280,10 +278,10 @@ local plugins = {
endpoint = "https://api.anthropic.com",
model = "claude-sonnet-4-20250514",
timeout = 30000, -- Timeout in milliseconds
extra_request_body = {
temperature = 0.75,
max_tokens = 20480,
},
extra_request_body = {
temperature = 0.75,
max_tokens = 20480,
},
},
moonshot = {
endpoint = "https://api.moonshot.ai/v1",
@@ -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