File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1618,6 +1618,18 @@ in
1618
1618
} ;
1619
1619
} ;
1620
1620
options . settings = {
1621
+ fail-on-change =
1622
+ mkOption {
1623
+ type = types . bool ;
1624
+ description = "Fail if some files require re-formatting." ;
1625
+ default = true ;
1626
+ } ;
1627
+ no-cache =
1628
+ mkOption {
1629
+ type = types . bool ;
1630
+ description = "Ignore the evaluation cache entirely." ;
1631
+ default = true ;
1632
+ } ;
1621
1633
formatters = mkOption {
1622
1634
type = types . listOf types . package ;
1623
1635
description = "The formatter packages configured by treefmt" ;
@@ -3693,7 +3705,16 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
3693
3705
pass_filenames = true ;
3694
3706
package = wrapper ;
3695
3707
packageOverrides = { treefmt = tools . treefmt ; } ;
3696
- entry = "${ hooks . treefmt . package } /bin/treefmt --fail-on-change" ;
3708
+ entry =
3709
+ let
3710
+ cmdArgs =
3711
+ mkCmdArgs
3712
+ ( with hooks . treefmt . settings ; [
3713
+ [ fail-on-change "--fail-on-change" ]
3714
+ [ no-cache "--no-cache" ]
3715
+ ] ) ;
3716
+ in
3717
+ "${ hooks . treefmt . package } /bin/treefmt ${ cmdArgs } " ;
3697
3718
} ;
3698
3719
trim-trailing-whitespace =
3699
3720
{
You can’t perform that action at this time.
0 commit comments