Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/python-basedpyright/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Basedpyright Python Pack

**Requirements:** `python` must be in your `PATH` and executable

This plugin pack does the following:

- Adds `basedpyright` language server

**Note:** This pack does not include Python syntax highlighting or debugging. Use [Python Pack](../python) for that.
50 changes: 50 additions & 0 deletions lua/astrocommunity/pack/python-basedpyright/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
return {
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
---@diagnostic disable: missing-fields
config = {
basedpyright = {
before_init = function(_, c)
if not c.settings then c.settings = {} end
if not c.settings.python then c.settings.python = {} end
c.settings.python.pythonPath = vim.fn.exepath "python"
end,
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "basic",
autoImportCompletions = true,
diagnosticSeverityOverrides = {
reportUnusedImport = "information",
reportUnusedFunction = "information",
reportUnusedVariable = "information",
reportGeneralTypeIssues = "none",
reportOptionalMemberAccess = "none",
reportOptionalSubscript = "none",
reportPrivateImportUsage = "none",
},
},
},
},
},
},
},
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "basedpyright" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "basedpyright" })
end,
},
}
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/python-black/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Python Black Pack

**Requirements:** `python` must be in your `PATH` and executable

This plugin pack does the following:

- Adds [black](https://pypi.org/project/black/) formatter

**Note:** This pack does not include Python syntax highlighting or debugging. Use [Python Pack](../python) for that.
25 changes: 25 additions & 0 deletions lua/astrocommunity/pack/python-black/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
{
"jay-babu/mason-null-ls.nvim",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's still needed for backwards compatibility?

optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "black" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "black" })
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = function(_, opts)
if not opts.formatters_by_ft then opts.formatters_by_ft = {} end
if not opts.formatters_by_ft.python then opts.formatters_by_ft.python = {} end
table.insert(opts.formatters_by_ft.python, "black")
end,
},
}
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/python-isort/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Python Isort Pack

**Requirements:** `python` must be in your `PATH` and executable

This plugin pack does the following:

- Adds [isort](https://pypi.org/project/isort/) formatter

**Note:** This pack does not include Python syntax highlighting or debugging. Use [Python Pack](../python) for that.
25 changes: 25 additions & 0 deletions lua/astrocommunity/pack/python-isort/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
{
"jay-babu/mason-null-ls.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "isort" })
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "isort" })
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = function(_, opts)
if not opts.formatters_by_ft then opts.formatters_by_ft = {} end
if not opts.formatters_by_ft.python then opts.formatters_by_ft.python = {} end
table.insert(opts.formatters_by_ft.python, 1, "isort")
end,
},
}
4 changes: 0 additions & 4 deletions lua/astrocommunity/pack/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
This plugin pack does the following:

- Adds `python` and `toml` Treesitter parsers
- Adds `basedpyright` language server
- Adds the following `null-ls` sources:
- [black](https://pypi.org/project/black/)
- [isort](https://pypi.org/project/isort/)
- Adds `debugpy` for debugging
60 changes: 1 addition & 59 deletions lua/astrocommunity/pack/python/init.lua
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
return {
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
---@diagnostic disable: missing-fields
config = {
basedpyright = {
before_init = function(_, c)
if not c.settings then c.settings = {} end
if not c.settings.python then c.settings.python = {} end
c.settings.python.pythonPath = vim.fn.exepath "python"
end,
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "basic",
autoImportCompletions = true,
diagnosticSeverityOverrides = {
reportUnusedImport = "information",
reportUnusedFunction = "information",
reportUnusedVariable = "information",
reportGeneralTypeIssues = "none",
reportOptionalMemberAccess = "none",
reportOptionalSubscript = "none",
reportPrivateImportUsage = "none",
},
},
},
},
},
},
},
},
{
"nvim-treesitter/nvim-treesitter",
optional = true,
Expand All @@ -42,20 +8,6 @@ return {
end
end,
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "basedpyright" })
end,
},
{
"jay-babu/mason-null-ls.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "black", "isort" })
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
optional = true,
Expand All @@ -69,8 +21,7 @@ return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed =
require("astrocore").list_insert_unique(opts.ensure_installed, { "basedpyright", "black", "isort", "debugpy" })
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "debugpy" })
end,
},
{
Expand Down Expand Up @@ -116,13 +67,4 @@ return {
table.insert(opts.adapters, require "neotest-python"(require("astrocore").plugin_opts "neotest-python"))
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
python = { "isort", "black" },
},
},
},
}