Skip to content

Commit

Permalink
fix: resolve black formatting issues
Browse files Browse the repository at this point in the history
- black did not respect pyproject.toml
- ruff-lsp did not start properly due to missing "packaging" dependency
  • Loading branch information
water-sucks committed Oct 9, 2023
1 parent 4211721 commit 69f3e11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion home/profiles/base/nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
path = v;
})
plugins);

ruff-lsp = with pkgs;
python3Packages.ruff-lsp.overridePythonAttrs (o: {
propagatedBuildInputs = o.propagatedBuildInputs ++ [python3Packages.packaging];
});
in
lib.mkMerge [
{
Expand Down Expand Up @@ -104,7 +109,7 @@ in
nodePackages.graphql-language-service-cli
nodePackages.typescript-language-server
pyright
python3Packages.ruff-lsp
ruff-lsp
stable.nodePackages.vscode-langservers-extracted
typst-lsp

Expand Down
6 changes: 5 additions & 1 deletion home/profiles/base/nvim/lua/plugins/lsp/servers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ local servers = {
local efm_sources = {
formatters = {
asmfmt = { formatCommand = "asmfmt", formatStdin = true },
black = { formatCommand = "black --no-color -q -", formatStdin = true },
black = {
formatCommand = "black --no-color -q -",
formatStdin = true,
rootMarkers = { "pyproject.toml", "requirements.txt", ".git" },
},
latexindent = { formatCommand = "latexindent -l -", formatStdin = true },
prettier = {
formatCanRange = true,
Expand Down

0 comments on commit 69f3e11

Please sign in to comment.