ruff python

This commit is contained in:
Henrik Bakken
2024-05-19 23:20:06 +02:00
parent f3775f9c9d
commit d435fa09c4
+5 -14
View File
@@ -503,7 +503,7 @@ require("lazy").setup({
-- Highlight, edit, and navigate code -- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
config = function() config = function()
pcall(require("nvim-treesitter.install").update({ with_sync = true })) pcall(require("nvim-treesitter.install").update())
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = { "c", "cpp", "lua", "vimdoc", "gitcommit", "git_rebase", "bash", "python" }, ensure_installed = { "c", "cpp", "lua", "vimdoc", "gitcommit", "git_rebase", "bash", "python" },
auto_install = true, auto_install = true,
@@ -591,29 +591,20 @@ require("lazy").setup({
log_level = vim.log.levels.DEBUG, log_level = vim.log.levels.DEBUG,
filetype = { filetype = {
python = { python = {
require("formatter.filetypes.python").black,
-- require("formatter.filetypes.python").pyment,
function() function()
return { return {
exe = "isort", exe = "ruff",
args = { "--quiet", "--profile black", "--force-single-line-import", "-" }, args = { "check", "--fix", "-" },
stdin = true, stdin = true,
} }
end, end,
function() function()
return { return {
exe = "black", -- TODO move to ruff exe = "ruff",
args = { "--quiet", "-C", "--line-length", "100", "--target-version py312", "-" }, args = { "format", "-" },
stdin = true, stdin = true,
} }
end, end,
function()
return {
exe = "blackdoc",
args = { "-q", "--line-length", "100", "-t py312" },
stdin = false,
}
end,
}, },
go = { require("formatter.filetypes.go").gofumpt, require("formatter.filetypes.go").golines }, go = { require("formatter.filetypes.go").gofumpt, require("formatter.filetypes.go").golines },
lua = { lua = {