twbs / grunt-bootlint

A Grunt wrapper for Bootlint, the HTML linter for Bootstrap projects

Home Page:https://www.npmjs.com/package/grunt-bootlint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix file input check

zacechola opened this issue · comments

@zacechola: maybe it will be worth borrowing the code from https://github.com/gruntjs/grunt-contrib-htmlmin/blob/master/tasks/htmlmin.js#L22 for the src/input checks.

So after beating my head here for awhile looking at how grunt's core plugins handle it, I finally figured it out.

bootlint: {
  missing_files: {
    src: ['totally/missing/thing/'],
    nonull: true
  },
}

Grunt ignores missing files unless you specifically tell it not to with the nonull option. If you do, that's when it'll log out the warning. The docs aren't super clear here, but once you start digging into the code, you'll see that's exactly what the option is used for.

Also, looks like grunt.log.warn seems to be the defacto standard with this, rather than exiting, so I'm going to leave it as is unless I can be convinced otherwise.

There's been some discussion about this for some time in grunt land. For example: gruntjs/grunt-contrib-uglify#3

Closing this as it appears to be expected behavior from Grunt to ignore missing files by default.