Skip to content

Commit

Permalink
feat: Add Pylint and make it work in a virtualenv (#142)
Browse files Browse the repository at this point in the history
* Add Pylint and make it work in a virtualenv

* Format with stylua
  • Loading branch information
sgarcialaguna authored Apr 27, 2023
1 parent 4151730 commit 6d92e41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/astrocommunity/pack/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ This plugin pack does the following:
- Adds the following `null-ls` sources:
- [black](https://pypi.org/project/black/)
- [isort](https://pypi.org/project/isort/)
- [pylint](https://pypi.org/project/pylint/)
- Adds `debugpy` for debugging
- Adds [venv-selector.nvim](https://github.com/linux-cultist/venv-selector.nvim) for virtual environment management
9 changes: 8 additions & 1 deletion lua/astrocommunity/pack/python/python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return {
-- Ensure that opts.ensure_installed exists and is a table.
if not opts.ensure_installed then opts.ensure_installed = {} end
-- Add to opts.ensure_installed using vim.list_extend.
utils.list_insert_unique(opts.ensure_installed, { "isort", "black" })
utils.list_insert_unique(opts.ensure_installed, { "isort", "black", "pylint" })
end,
},
{
Expand All @@ -45,4 +45,11 @@ return {
opts = {},
keys = { { "<leader>lv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
},
{
-- This is needed for pylint to work in a virtualenv. See https://github.com/williamboman/mason.nvim/issues/668#issuecomment-1320859097
"williamboman/mason.nvim",
opts = {
PATH = "append",
},
},
}

0 comments on commit 6d92e41

Please sign in to comment.