File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1875,6 +1875,12 @@ in
18751875 default = "" ;
18761876 example = ".yamlfmt" ;
18771877 } ;
1878+ lint-only =
1879+ mkOption {
1880+ type = types . bool ;
1881+ description = "Only lint the files, do not format them in place." ;
1882+ default = true ;
1883+ } ;
18781884 } ;
18791885 } ;
18801886 } ;
@@ -3906,10 +3912,10 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
39063912 cmdArgs =
39073913 mkCmdArgs
39083914 ( with hooks . yamlfmt . settings ; [
3909- # Exit non-zero on changes
3910- [ true "-lint" ]
3911- # But do not print the diff
3912- [ true "-quiet" ]
3915+ # Exit with non-zero status if the file is not formatted
3916+ [ lint-only "-lint" ]
3917+ # Do not print the diff
3918+ [ lint-only "-quiet" ]
39133919 # See https://github.com/google/yamlfmt/blob/main/docs/config-file.md#config-file-discovery
39143920 [ ( configPath != "" ) "-conf ${ configPath } " ]
39153921 ] ) ;
You can’t perform that action at this time.
0 commit comments