Change python tools for astral

closes #2
This commit is contained in:
Alexander Navarro 2024-09-13 09:57:44 -03:00
parent 8b85cf7c9e
commit dc0260c20c
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
6 changed files with 1461 additions and 15 deletions

View file

@ -11,7 +11,7 @@ return {
-- Use a stop_after_first = true to run only the first available formatter -- Use a stop_after_first = true to run only the first available formatter
-- Use the "_" filetype to run formatters on filetypes that don't -- Use the "_" filetype to run formatters on filetypes that don't
-- have other formatters configured. -- have other formatters configured.
["_"] = { "trim_whitespace", "injected" }, ["_"] = { "trim_whitespace" },
blade = { "blade-formatter" }, blade = { "blade-formatter" },
css = { "prettierd", "prettier" }, css = { "prettierd", "prettier" },
go = { "gofumpt", "goimports_reviser", "golines" }, go = { "gofumpt", "goimports_reviser", "golines" },
@ -24,7 +24,7 @@ return {
markdown = { "markdownlint" }, markdown = { "markdownlint" },
nim = { "nimpretty" }, nim = { "nimpretty" },
php = { "pint" }, php = { "pint" },
python = { "blue" }, python = { "ruff_format", "ruff_organize_imports" },
scss = { "prettierd", "prettier", stop_after_first = true }, scss = { "prettierd", "prettier", stop_after_first = true },
sh = { "shfmt" }, sh = { "shfmt" },
typescript = { "prettierd", "prettier", stop_after_first = true }, typescript = { "prettierd", "prettier", stop_after_first = true },

View file

@ -13,7 +13,7 @@ return {
javascriptreact = { "eslint_d" }, javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" }, typescriptreact = { "eslint_d" },
-- astro = { "eslint_d" }, -- astro = { "eslint_d" },
python = { "pylint" }, python = { "ruff" },
sh = { "shellcheck" }, sh = { "shellcheck" },
NeogitCommitMessage = { "gitlint" }, NeogitCommitMessage = { "gitlint" },
gitcommit = { "gitlint" }, gitcommit = { "gitlint" },

View file

@ -42,6 +42,11 @@ return {
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic") nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic") nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
nmap("<leader>lK", function()
-- execute twice to enter the float inmediatly
vim.diagnostic.open_float()
vim.diagnostic.open_float()
end, "Hover current diagnostic")
-- Create a command `:Format` local to the LSP buffer -- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_) vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
@ -91,6 +96,7 @@ return {
}, },
}, },
}, },
ruff = {},
rust_analyzer = { rust_analyzer = {
settings = { settings = {
["rust-analyzer"] = { ["rust-analyzer"] = {
@ -178,18 +184,23 @@ return {
}) })
vim.diagnostic.config({ vim.diagnostic.config({
underline = true,
update_in_insert = false, update_in_insert = false,
virtual_text = false, underline = true,
-- virtual_text = { float = {
-- spacing = 1, source = true
-- source = "if_many", },
-- prefix = " ●", virtual_text = {
-- suffix = " ", severity = vim.diagnostic.severity.ERROR,
-- -- this will set set the prefix to a function that returns the diagnostics icon based on the severity source = true,
-- -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported spacing = -1,
-- -- prefix = "icons", prefix = nil,
-- }, format = function(diagnostic)
-- show small error code instead of whole error that probably won't fit in the screen
-- to see the whole error use other keybindings
return tostring(diagnostic.code)
end,
virt_text_hide = true
},
severity_sort = true, severity_sort = true,
}) })

View file

@ -6,7 +6,7 @@ return {
opts = { opts = {
ensure_installed = { ensure_installed = {
"blue", "blue",
"pylint", "ruff",
"eslint_d", "eslint_d",
"markdownlint", "markdownlint",
"nimlsp", "nimlsp",

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,7 @@ export NODE_PATH="$NPM_PACKAGES/lib/node_modules${NODE_PATH:+:$NODE_PATH}"
export PNPM_HOME="$HOME/.local/share/pnpm" export PNPM_HOME="$HOME/.local/share/pnpm"
export ESLINT_USE_FLAT_CONFIG=true export ESLINT_USE_FLAT_CONFIG=true
. "$HOME/.cargo/env" . "$HOME/.cargo/env"
source "$HOME/.rye/env"
# Unset manpath so we can inherit from /etc/manpath via the `manpath` # Unset manpath so we can inherit from /etc/manpath via the `manpath`
# command # command