mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
Merge pull request #159 from ksonj/python-isort
languages/python: add black-and-isort formatter
This commit is contained in:
commit
0631fccccf
2 changed files with 30 additions and 0 deletions
|
@ -73,3 +73,5 @@ https://github.com/jacekpoz[jacekpoz]:
|
||||||
https://github.com/ksonj[ksonj]:
|
https://github.com/ksonj[ksonj]:
|
||||||
|
|
||||||
* Add support to change mappings to utility/surround
|
* Add support to change mappings to utility/surround
|
||||||
|
|
||||||
|
* Add black-and-isort python formatter
|
||||||
|
|
|
@ -39,6 +39,34 @@ with builtins; let
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
isort = {
|
||||||
|
package = pkgs.isort;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.isort.with({
|
||||||
|
command = "${cfg.format.package}/bin/isort",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
black-and-isort = {
|
||||||
|
package = pkgs.writeShellApplication {
|
||||||
|
name = "black";
|
||||||
|
text = ''
|
||||||
|
black --quiet - "$@" | isort --profile black -
|
||||||
|
'';
|
||||||
|
runtimeInputs = [pkgs.black pkgs.isort];
|
||||||
|
};
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.black.with({
|
||||||
|
command = "${cfg.format.package}/bin/black",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultDebugger = "debugpy";
|
defaultDebugger = "debugpy";
|
||||||
|
|
Loading…
Reference in a new issue