Skip to content

Commit

Permalink
Add profile setting to isort hook
Browse files Browse the repository at this point in the history
  • Loading branch information
totoroot committed Aug 17, 2023
1 parent 3e3d45c commit c249b6e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ in
default = null;
};
};
isort =
{
profile =
mkOption {
type = types.enum [ "" "black" "django" "pycharm" "google" "open_stack" "plone" "attrs" "hug" "wemake" "appnexus" ];
description = lib.mdDoc "Built-in profiles to allow easy interoperability with common projects and code styles.";
default = "";
};
};
ormolu =
{
defaultExtensions =
Expand Down Expand Up @@ -805,8 +814,16 @@ in
{
name = "isort";
description = "A Python utility / library to sort imports.";
entry = "${pkgs.python3Packages.isort}/bin/isort";
types = [ "file" "python" ];
entry =
let
cmdArgs =
mkCmdArgs
(with settings.isort; [
[ (profile != "") " --profile ${profile}" ]
]);
in
"${pkgs.python3Packages.isort}/bin/isort${cmdArgs}";
};
latexindent =
{
Expand Down

0 comments on commit c249b6e

Please sign in to comment.