File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ module.exports = function (grunt) {
4949 src : 'test/work/missing.html'
5050 } ,
5151 incomplete : {
52+ options : {
53+ quiet : true
54+ } ,
5255 src : 'test/work/incomplete.html'
5356 } ,
5457 minimal : {
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ or integrate it to your build sequence in `Gruntfile.js`:
5454grunt .registerTask (' default' , [' tidy-html5' , ... ]);
5555```
5656
57+ Warnings about invalid parts of the HTML markup will be logged on the console,
58+ if the ` quiet ` mode is not enabled. If there are any, unless the task
59+ execution is ` force ` d, the task will make Grunt fail.
60+
5761## Customizing
5862
5963Default behaviour of the task can be tweaked by the task options; these
@@ -65,6 +69,7 @@ grunt.initConfig({
6569 task: {
6670 options: {
6771 force: false ,
72+ quiet: false ,
6873 ignoreMissing: false ,
6974 tidyOptions: {}
7075 },
@@ -83,6 +88,13 @@ Default: `false`
8388Suppresses reporting the failure to Grunt and thus stopping execution
8489of further tasks, if set to ` true ` .
8590
91+ #### quiet
92+ Type: ` Boolean `
93+ Default: ` false `
94+
95+ Suppresses printing of errors and warnings about problems found in input
96+ files on the console. if set to ` true ` .
97+
8698#### ignoreMissing
8799Type: ` Boolean `
88100Default: ` false `
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ module.exports = function (grunt) {
1717 const done = this . async ( )
1818 const options = this . options ( {
1919 force : false ,
20+ quiet : false ,
2021 ignoreMissing : false ,
2122 tidyOptions : { }
2223 } )
2324 const force = options . force
25+ const quiet = options . quiet
2426 const ignoreMissing = options . ignoreMissing
2527 const tidyOptions = options . tidyOptions
2628 const files = this . files
@@ -82,7 +84,9 @@ module.exports = function (grunt) {
8284 . then ( function ( result ) {
8385 const errors = result . errlog
8486 if ( errors . length ) {
85- grunt . log . write ( errors )
87+ if ( ! quiet ) {
88+ grunt . log . write ( errors )
89+ }
8690 ++ failed
8791 }
8892 } )
You can’t perform that action at this time.
0 commit comments