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 } ;
@@ -3878,10 +3884,10 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
38783884 cmdArgs =
38793885 mkCmdArgs
38803886 ( with hooks . yamlfmt . settings ; [
3881- # Exit non-zero on changes
3882- [ true "-lint" ]
3883- # But do not print the diff
3884- [ true "-quiet" ]
3887+ # Exit with non-zero status if the file is not formatted
3888+ [ lint-only "-lint" ]
3889+ # Do not print the diff
3890+ [ lint-only "-quiet" ]
38853891 # See https://github.com/google/yamlfmt/blob/main/docs/config-file.md#config-file-discovery
38863892 [ ( configPath != "" ) "-conf ${ configPath } " ]
38873893 ] ) ;
You can’t perform that action at this time.
0 commit comments