Skip to content

Commit 6184635

Browse files
authored
Merge pull request #403 from benhiemer/feat-add-black-flags
feat: introduce black flags
2 parents c75cea7 + 8fc4dd7 commit 6184635

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

modules/hooks.nix

+15-1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,20 @@ in
136136
};
137137
};
138138
};
139+
black = mkOption {
140+
description = lib.mdDoc "black hook";
141+
type = types.submodule {
142+
imports = hookModule;
143+
options.settings = {
144+
flags = mkOption {
145+
type = types.str;
146+
description = lib.mdDoc "Flags passed to black. See all available [here](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#command-line-options).";
147+
default = "";
148+
example = "--skip-magic-trailing-comma";
149+
};
150+
};
151+
};
152+
};
139153
clippy = mkOption {
140154
description = lib.mdDoc "clippy hook";
141155
type = types.submodule {
@@ -1596,7 +1610,7 @@ in
15961610
name = "black";
15971611
description = "The uncompromising Python code formatter";
15981612
package = tools.black;
1599-
entry = "${hooks.black.package}/bin/black";
1613+
entry = "${hooks.black.package}/bin/black ${hooks.black.settings.flags}";
16001614
types = [ "file" "python" ];
16011615
};
16021616
cabal-fmt =

0 commit comments

Comments
 (0)