-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pack)!: Split python pack into python and python-ruff (#603)
* feat(pack): Split python pack into python and python-ruff * fix(python-ruff): Don't use black and isort in ruff pack
- Loading branch information
Showing
4 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Python Ruff Language Pack | ||
|
||
**Requirements:** `python` must be in your `PATH` and executable | ||
|
||
This plugin pack does the following: | ||
|
||
- Adds `python` and `toml` Treesitter parsers | ||
- Adds `pyright` and `ruff_lsp` language servers | ||
- Adds the following `null-ls` sources: | ||
- [ruff](https://pypi.org/project/ruff/) | ||
- Adds `debugpy` for debugging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local utils = require "astronvim.utils" | ||
return { | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = function(_, opts) | ||
if opts.ensure_installed ~= "all" then | ||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "python", "toml" }) | ||
end | ||
end, | ||
}, | ||
{ | ||
"williamboman/mason-lspconfig.nvim", | ||
opts = function(_, opts) | ||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "pyright", "ruff_lsp" }) | ||
end, | ||
}, | ||
{ | ||
"jay-babu/mason-null-ls.nvim", | ||
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "ruff" }) end, | ||
}, | ||
{ | ||
"jay-babu/mason-nvim-dap.nvim", | ||
opts = function(_, opts) | ||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "python") | ||
if not opts.handlers then opts.handlers = {} end | ||
opts.handlers.python = function() end -- make sure python doesn't get set up by mason-nvim-dap, it's being set up by nvim-dap-python | ||
end, | ||
}, | ||
{ | ||
"linux-cultist/venv-selector.nvim", | ||
opts = {}, | ||
keys = { { "<leader>lv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } }, | ||
}, | ||
{ | ||
"mfussenegger/nvim-dap-python", | ||
dependencies = "mfussenegger/nvim-dap", | ||
ft = "python", -- NOTE: ft: lazy-load on filetype | ||
config = function(_, opts) | ||
local path = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python" | ||
require("dap-python").setup(path, opts) | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters