Trying to fix ty and ruff conflicts, and added some stuff for golang

This commit is contained in:
Nikita Avgustanov 2026-02-20 11:08:35 +04:00
parent 5233c6a3d2
commit c7e0fbb556
3 changed files with 89 additions and 20 deletions

View File

@ -690,14 +690,7 @@ require('lazy').setup({
bashls = {}, bashls = {},
jsonls = {}, jsonls = {},
yamlls = {}, yamlls = {},
ty = { ruff = {},
configuration = {
rules = {
['unresolved-reference'] = 'warn',
diagnosticMode = 'workspace',
},
},
},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
@ -740,7 +733,6 @@ require('lazy').setup({
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
'stylua', -- Used to format Lua code 'stylua', -- Used to format Lua code
'ruff',
}) })
require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-tool-installer').setup { ensure_installed = ensure_installed }
@ -752,7 +744,7 @@ require('lazy').setup({
'solargraph', 'solargraph',
'bashls', 'bashls',
'lua_ls', 'lua_ls',
'ty', 'ruff',
}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) }, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
automatic_installation = false, automatic_installation = false,
handlers = { handlers = {
@ -802,14 +794,6 @@ require('lazy').setup({
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
go = { 'gofmt' }, go = { 'gofmt' },
python = {
-- To fix auto-fixable lint errors.
'ruff_fix',
-- To run the Ruff formatter.
'ruff_format',
-- To organize the imports.
'ruff_organize_imports',
},
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" }, -- python = { "isort", "black" },
-- --
@ -997,7 +981,23 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'go', 'yaml', 'json' }, ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'go',
'yaml',
'json',
'python',
},
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {

View File

@ -0,0 +1,70 @@
return {
{
'olexsmir/gopher.nvim',
ft = 'go',
-- branch = "develop"
-- (optional) updates the plugin's dependencies on each update
build = function()
vim.cmd.GoInstallDeps()
end,
---@module "gopher"
---@type gopher.Config
opts = {},
config = function()
require('gopher').setup {
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
log_level = vim.log.levels.INFO,
-- timeout for running internal commands
timeout = 2000,
-- timeout for running installer commands(e.g :GoDepsInstall, :GoDepsInstallSync)
installer_timeout = 999999,
-- user specified paths to binaries
commands = {
go = 'go',
gomodifytags = 'gomodifytags',
gotests = 'gotests',
impl = 'impl',
iferr = 'iferr',
},
gotests = {
-- a default template that gotess will use.
-- gotets doesn't have template named `default`, we use it to represent absence of the provided template.
template = 'default',
-- path to a directory containing custom test code templates
template_dir = nil,
-- use named tests(map with test name as key) in table tests(slice of structs by default)
named = false,
},
gotag = {
transform = 'snakecase',
-- default tags to add to struct fields
default_tag = 'json',
-- default tag option added struct fields, set to nil to disable
-- e.g: `option = "json=omitempty,xml=omitempty`
option = nil,
},
iferr = {
-- choose a custom error message, nil to use default
-- e.g: `message = 'fmt.Errorf("failed to %w", err)'`
message = nil,
},
json2go = {
-- command used to open interactive input.
-- e.g: `split`, `botright split`, `tabnew`
interactive_cmd = 'vsplit',
-- name of autogenerated struct
-- e.g: "MySuperCoolName"
type_name = nil,
},
}
end,
},
}

View File

@ -7,7 +7,6 @@ return {
local lint = require 'lint' local lint = require 'lint'
lint.linters_by_ft = { lint.linters_by_ft = {
markdown = { 'markdownlint' }, markdown = { 'markdownlint' },
python = { 'ruff' },
} }
-- 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,