build-system/tasks/check-rules.js
function checkForbiddenAndRequiredTerms() {
  var forbiddenFound = false;
  var missingRequirements = false;
  return gulp.src(srcGlobs)
    .pipe(through2.obj(function(file, enc, cb) {
      forbiddenFound = hasAnyTerms(file) || forbiddenFound;
      missingRequirements = isMissingTerms(file) || missingRequirements;
      cb();
    }))
    .on('end', function() {
      if (forbiddenFound) {
        util.log(util.colors.blue(
            'Please remove these usages or consult with the Web Activities team.'));
      }
      if (missingRequirements) {
        util.log(util.colors.blue(
            'Adding these terms (e.g. by adding a required LICENSE ' +
            'to the file)'));
      }
      if (forbiddenFound || missingRequirements) {
        process.exit(1);
      }
    });
}
function checkForbiddenAndRequiredTerms() {
  var forbiddenFound = false;
  var missingRequirements = false;
  return gulp.src(srcGlobs)
    .pipe(through2.obj(function(file, enc, cb) {
      forbiddenFound = hasAnyTerms(file) || forbiddenFound;
      missingRequirements = isMissingTerms(file) || missingRequirements;
      cb();
    }))
    .on('end', function() {
      if (forbiddenFound) {
        util.log(util.colors.blue(
            'Please remove these usages or consult with the Web Activities team.'));
      }
      if (missingRequirements) {
        util.log(util.colors.blue(
            'Adding these terms (e.g. by adding a required LICENSE ' +
            'to the file)'));
      }
      if (forbiddenFound || missingRequirements) {
        process.exit(1);
      }
    });
}
function checkForbiddenAndRequiredTerms ( ) { var forbiddenFound = false ; var missingRequirements = false ; return gulp . src ( srcGlobs ) . pipe ( through2 . obj ( function ( file , enc , cb ) { forbiddenFound = hasAnyTerms ( file ) || forbiddenFound ; missingRequirements = isMissingTerms ( file ) || missingRequirements ; cb ( ) ; } ) ) . on ( 'end' , function ( ) { if ( forbiddenFound ) { util . log ( util . colors . blue ( 'Please remove these usages or consult with the Web Activities team.' ) ) ; } if ( missingRequirements ) { util . log ( util . colors . blue ( 'Adding these terms (e.g. by adding a required LICENSE ' + 'to the file)' ) ) ; } if ( forbiddenFound || missingRequirements ) { process . exit ( 1 ) ; } } ) ; }
Check a file for all the required terms and
any forbidden terms and log any errors found.
Check a file for all the required terms and any forbidden terms and log any errors found .