From 935be8d9063893e9e0b2dd85f96545b6d274c873 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 23 Sep 2024 21:50:02 -0300 Subject: [PATCH] feat(neovim): add python lsp, lint and formatting --- modules/home-manager/programs/neovim/default.nix | 5 +++++ modules/home-manager/programs/neovim/lua/plugins/none-ls.lua | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index d07c09c..8124a29 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -76,6 +76,11 @@ in nixd nixfmt-rfc-style + # Python + basedpyright + python312Packages.flake8 + ruff + # TypeScript typescript-language-server diff --git a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua index 5601ff7..54a1e5c 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua @@ -3,6 +3,9 @@ ---@type LazySpec return { "nvimtools/none-ls.nvim", + dependencies = { + "nvimtools/none-ls-extras.nvim", + }, opts = function(_, config) -- config variable is the default configuration table for the setup function call local null_ls = require("null-ls") @@ -12,9 +15,11 @@ return { -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics config.sources = { -- Set a formatter + require("none-ls.diagnostics.flake8"), null_ls.builtins.formatting.clang_format, null_ls.builtins.formatting.nixfmt, null_ls.builtins.formatting.prettier, + require("none-ls.formatting.ruff"), null_ls.builtins.formatting.stylua, } return config -- return final config table