File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 972972 imports = [ hookModule ] ;
973973 } ;
974974 } ;
975+ nil = mkOption {
976+ description = "nil hook" ;
977+ type = types . submodule {
978+ imports = [ hookModule ] ;
979+ options . settings = {
980+ denyWarnings = mkOption {
981+ type = types . bool ;
982+ description = "Treat warnings like errors and exit with non-zero code" ;
983+ default = false ;
984+ } ;
985+ } ;
986+ } ;
987+ } ;
975988 nixfmt = mkOption {
976989 description = "nixfmt hook" ;
977990 type = types . submodule {
@@ -3439,11 +3452,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
34393452 package = tools . nil ;
34403453 entry =
34413454 let
3455+ cmdArgs = mkCmdArgs ( with hooks . nil . settings ; [
3456+ [ denyWarnings "--deny-warnings" ]
3457+ ] ) ;
34423458 script = pkgs . writeShellScript "precommit-nil" ''
34433459 errors=false
34443460 echo Checking: $@
34453461 for file in $(echo "$@"); do
3446- ${ hooks . nil . package } /bin/nil diagnostics "$file"
3462+ ${ hooks . nil . package } /bin/nil diagnostics ${ cmdArgs } "$file"
34473463 exit_code=$?
34483464
34493465 if [[ $exit_code -ne 0 ]]; then
You can’t perform that action at this time.
0 commit comments