build-system/tasks/check-rules.js
function isMissingTerms(file) {
  var contents = file.contents.toString();
  return Object.keys(requiredTerms).map(function(term) {
    var filter = requiredTerms[term];
    if (!filter.test(file.path)) {
      return false;
    }

    var matches = contents.match(new RegExp(term));
    if (!matches) {
      util.log(util.colors.red('Did not find required: "' + term +
          '" in ' + file.relative));
      util.log(util.colors.blue('=========='));
      return true;
    }
    return false;
  }).some(function(hasMissingTerm) {
    return hasMissingTerm;
  });
}
function isMissingTerms(file) {
  var contents = file.contents.toString();
  return Object.keys(requiredTerms).map(function(term) {
    var filter = requiredTerms[term];
    if (!filter.test(file.path)) {
      return false;
    }

    var matches = contents.match(new RegExp(term));
    if (!matches) {
      util.log(util.colors.red('Did not find required: "' + term +
          '" in ' + file.relative));
      util.log(util.colors.blue('=========='));
      return true;
    }
    return false;
  }).some(function(hasMissingTerm) {
    return hasMissingTerm;
  });
}
function isMissingTerms ( file ) { var contents = file . contents . toString ( ) ; return Object . keys ( requiredTerms ) . map ( function ( term ) { var filter = requiredTerms [ term ] ; if ( ! filter . test ( file . path ) ) { return false ; } var matches = contents . match ( new RegExp ( term ) ) ; if ( ! matches ) { util . log ( util . colors . red ( 'Did not find required: "' + term + '" in ' + file . relative ) ) ; util . log ( util . colors . blue ( '==========' ) ) ; return true ; } return false ; } ) . some ( function ( hasMissingTerm ) { return hasMissingTerm ; } ) ; }
Test if a file's contents fail to match any of the required terms and log
any missing terms

@param {!File} file file is a vinyl file object
@return {boolean} true if any of the terms are not matched in the file
content, false otherwise
Test if a file s contents fail to match any of the required terms and log any missing terms