File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 290
290
} ;
291
291
} ;
292
292
} ;
293
+ convco = mkOption {
294
+ description = "convco hook" ;
295
+ type = types . submodule {
296
+ imports = [ hookModule ] ;
297
+ options . settings = {
298
+ configPath =
299
+ mkOption {
300
+ type = types . nullOr ( types . oneOf [ types . str types . path ] ) ;
301
+ description = "Path to the configuration file (YAML or JSON)" ;
302
+ default = null ;
303
+ } ;
304
+ } ;
305
+ } ;
306
+ } ;
293
307
credo = mkOption {
294
308
description = "credo hook" ;
295
309
type = types . submodule {
@@ -2462,9 +2476,13 @@ in
2462
2476
package = tools . convco ;
2463
2477
entry =
2464
2478
let
2479
+ cmdArgs =
2480
+ mkCmdArgs ( with hooks . convco . settings ; [
2481
+ [ ( configPath != null ) "--config ${ configPath } " ]
2482
+ ] ) ;
2465
2483
convco = hooks . convco . package ;
2466
2484
script = pkgs . writeShellScript "precommit-convco" ''
2467
- cat $1 | ${ convco } /bin/convco check --from-stdin
2485
+ cat $1 | ${ convco } /bin/convco check --from-stdin ${ cmdArgs }
2468
2486
'' ;
2469
2487
# need version >= 0.4.0 for the --from-stdin flag
2470
2488
toolVersionCheck = lib . versionAtLeast convco . version "0.4.0" ;
You can’t perform that action at this time.
0 commit comments