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 301
301
} ;
302
302
} ;
303
303
} ;
304
+ convco = mkOption {
305
+ description = "convco hook" ;
306
+ type = types . submodule {
307
+ imports = [ hookModule ] ;
308
+ options . settings = {
309
+ configPath =
310
+ mkOption {
311
+ type = types . nullOr ( types . oneOf [ types . str types . path ] ) ;
312
+ description = "Path to the configuration file (YAML or JSON)" ;
313
+ default = null ;
314
+ } ;
315
+ } ;
316
+ } ;
317
+ } ;
304
318
credo = mkOption {
305
319
description = "credo hook" ;
306
320
type = types . submodule {
@@ -2542,9 +2556,13 @@ in
2542
2556
package = tools . convco ;
2543
2557
entry =
2544
2558
let
2559
+ cmdArgs =
2560
+ mkCmdArgs ( with hooks . convco . settings ; [
2561
+ [ ( configPath != null ) "--config ${ configPath } " ]
2562
+ ] ) ;
2545
2563
convco = hooks . convco . package ;
2546
2564
script = pkgs . writeShellScript "precommit-convco" ''
2547
- cat $1 | ${ convco } /bin/convco check --from-stdin
2565
+ cat $1 | ${ convco } /bin/convco check --from-stdin ${ cmdArgs }
2548
2566
'' ;
2549
2567
# need version >= 0.4.0 for the --from-stdin flag
2550
2568
toolVersionCheck = lib . versionAtLeast convco . version "0.4.0" ;
You can’t perform that action at this time.
0 commit comments