Lint project files (Docker, HTMLBars, Javascript, Markdown, and SASS)
@returns {Boolean} returns true if there are linting errors
187636
function lint () {
  console.log(
    chalk.gray('Running linting…\n')
  )

  // Run all linters
  const results = [
    dockerLinter,
    templateLinter,
    javascriptLinter,
    markdownLinter,
    sassLinter
  ]
    .map((Linter) => {
      const linter = new Linter()
      return linter.lint()
    })

  console.log(
    chalk.gray('\nlinting complete!')
  )

  const erred = results.indexOf(true) !== -1

  // If file was called via CLI and there are errors exit process with failed status
  if (require.main === module && erred) {
    process.exit(1)
  }

  return erred
}
146112
function(file) {
      var sections = file.contents.toString().split(END_REG);

      var blocks = [],
        files = [];

      var self = this;

      sections.forEach(function(s) {
        if (s.match(START_REG)) {
          // s[0] html code
          // s[1] string 'css' or 'js'
          // s[2] string dest url
          // s[3] tags of link or script
          s = s.split(START_REG);
          blocks.push(s[0]);
          switch (s[1]) {
            case 'css':
              blocks.push('<link rel="stylesheet" href="' + s[2] + '">');
              break;
            case 'js':
              blocks.push('<script src="' + s[2] + '"></script>');
              break;
            default:
              throw new gutil.PluginError('gulp-htmlbuild', 'only build:css build:js accept\n');
          }
          var paths = self.matchContentPaths(s[1] === 'css' ? CSSFILE_REG : JSFILE_REG, s[3]);
          var source = concatSource(paths);
          files.push({
            type: s[1],
            dest: resolveSrc(s[2], self.filedir),
            source: source
          });
        } else {
          blocks.push(s);
        }
      });

      return {
        blocks: blocks,
        files: files
      }
    }
788111
function hasErrors(results) {
  return  (results.dependencies && results.dependencies.length) ||
          (results.devDependencies && results.devDependencies.length)
}
878690
public boolean lint(String s) {
        // return true if either the specific option is enabled, or
        // they are all enabled without the specific one being
        // disabled
        return
            isSet(XLINT_CUSTOM, s) ||
            (isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) &&
                isUnset(XLINT_CUSTOM, "-" + s);
    }
326785
function isLodashPluginWithSemanticUiReact(plugin) {
    if (Array.isArray(plugin)) {
        // Babel 6 plugin is a tuple as an array [id, options]
        return (
            ["lodash", "babel-plugin-lodash"].includes(plugin[0].key) &&
            [].concat(plugin[1].id).includes("semantic-ui-react")
        );
    } else if (plugin != null && typeof plugin === "object") {
      // Babel 7 plugin is an object { key, options, ... }
        return (
            /[/\\]node_modules([/\\].*)?[/\\]babel-plugin-lodash([/\\].*)?$/.test(plugin.key) &&
            plugin.options &&
            plugin.options.id &&
            [].concat(plugin.options.id).includes("semantic-ui-react")
        );
    } else {
        return false;
    }
}
369945
function isDocker() {
    if (!isNode())
        return false;
    var hasEnv = function_1.tryWrap(function () {
        statSync('/.dockerenv');
        return true;
    })(false);
    var hasGroup = function_1.tryWrap(function () {
        return ~readFileSync('/proc/self/cgroup', 'utf8').indexOf('docker');
    })(false);
    return hasEnv || hasGroup;
}
732807
function checkSourceFileWorker(node) {
            var links = getNodeLinks(node);
            if (!(links.flags & 1 /* TypeChecked */)) {
                // If skipLibCheck is enabled, skip type checking if file is a declaration file.
                // If skipDefaultLibCheck is enabled, skip type checking if file contains a
                // '/// <reference no-default-lib="true"/>' directive.
                if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
                    return;
                }
                // Grammar checking
                checkGrammarSourceFile(node);
                potentialThisCollisions.length = 0;
                deferredNodes = [];
                deferredUnusedIdentifierNodes = produceDiagnostics && noUnusedIdentifiers ? [] : undefined;
                ts.forEach(node.statements, checkSourceElement);
                checkDeferredNodes();
                if (ts.isExternalModule(node)) {
                    registerForUnusedIdentifiersCheck(node);
                }
                if (!node.isDeclarationFile) {
                    checkUnusedIdentifiers();
                }
                deferredNodes = undefined;
                deferredUnusedIdentifierNodes = undefined;
                if (ts.isExternalOrCommonJsModule(node)) {
                    checkExternalModuleExports(node);
                }
                if (potentialThisCollisions.length) {
                    ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope);
                    potentialThisCollisions.length = 0;
                }
                links.flags |= 1 /* TypeChecked */;
            }
        }
37759
function _genericLintJs( src ) {
  // Pass all command line flags to ESLint.
  const options = minimist( process.argv.slice( 2 ) );
  let errorHandler = through2.obj();

  if ( options.travis ) {
    options.quiet = true;
    errorHandler = gulpEslint.failAfterError();
  }

  return gulp.src( src.concat( '!**/node_modules/**' ), { base: './' } )
    .pipe( gulpEslint( options ) )
    .pipe( gulpEslint.format() )
    .pipe( errorHandler )
    .pipe( gulp.dest( './' ) )
    .on( 'error', handleErrors );
}
540410
function check(directory, options) {
  var deferred = q.defer();

  var dir = path.resolve(process.cwd(), directory);
  util.info("\nSetting up in %s%s%s:", c.bldcyn, dir, c.txtrst);

  // **data**: All the markdown / yaml files.
  var dataPath =  path.resolve(dir, options.templates || "data");
  // **template**: All the Pug files.
  var templatePath =  path.resolve(dir, options.templates || "templates");
  // **output**: Static directory that includes HTML files.
  var outputPath =  path.resolve(dir, options.output || "public");
  // **css/js**: Additional directories that are created in the output directory.
  var cssPath =  path.resolve(dir, options.output || "public", "css");
  var jsPath =  path.resolve(dir, options.output || "public", "js");

  util.info("  %s%s", c.bldwht, dir); // Markade root directory
  util.info("  %s%s", c.bldwht, dataPath);
  util.info("  %s%s", c.bldwht, templatePath);
  util.info("  %s%s", c.bldwht, outputPath);
  util.info("  %s%s", c.bldwht, cssPath);
  util.info("  %s%s%s", c.bldwht, jsPath, c.txtrst);

  var json = {
    data: dataPath,
    template: templatePath,
    output: outputPath,
    css: cssPath,
    js: jsPath,
    root: dir
  };

  // And a confirmation is asked in the command line.
  rl.question("\n» Is that okay? ["+c.bldylw+"yes"+c.txtrst+"] " , function(answer) {
    if (answer == "y" || answer == "yes" || answer == "sure" || answer == "yup")
      deferred.resolve(json);
    else if (typeof answer == "undefined" || answer.length === 0)
      deferred.resolve(json);
    else {
      deferred.reject(false);
    }
  });

  return deferred.promise;
}
83824
function ls (onEnd) {
  const FN      = require('fstream-npm')
  const color   = require('chalk')
  const glob    = require('glob')
  const exclude = require('lodash.difference')

  const included = [ ]

  const all = glob.sync('**/**', { ignore : [ 'node_modules/**/**' ], nodir : true })

  FN({ path: process.cwd() })
    .on('child', function (e) {
      included.push(e._path.replace(e.root.path + '/', ''))
    })
    .on('end', function () {
      const excluded = exclude(all, included)

      console.info(color.magenta('\n\nWILL BE PUBLISHED\n'))
      console.info(color.green(included.join('\n')))
      console.info(color.magenta('\n\nWON\'T BE PUBLISHED\n'))
      console.info(color.red(excluded.join('\n')))
      console.info('\n\nYou can use .npmignore and the "files" field of package.json to manage these files.')
      console.info('See https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package\n')

      if (typeof onEnd === 'function') {
        onEnd({
          included : included,
          excluded : excluded
        })
      }
    })
}
661307
function lintOneFile(text, fullPath) {
        // If a line contains only whitespace (here spaces or tabs), remove the whitespace
        text = text.replace(/^[ \t]+$/gm, "");

        var options = prefs.get("options");

        _lastRunOptions = _.clone(options);

        if (!options) {
            options = {};
        } else {
            options = _.clone(options);
        }

        if (!options.indent) {
            // default to using the same indentation value that the editor is using
            options.indent = _getIndentSize(fullPath);
        }

        // If the user has not defined the environment, we use browser by default.
        var hasEnvironment = _.some(ENVIRONMENTS, function (env) {
            return options[env] !== undefined;
        });

        if (!hasEnvironment) {
            options.browser = true;
        }

        var jslintResult = JSLINT(text, options);

        if (!jslintResult) {
            // Remove any trailing null placeholder (early-abort indicator)
            var errors = JSLINT.errors.filter(function (err) { return err !== null; });

            errors = errors.map(function (jslintError) {
                return {
                    // JSLint returns 1-based line/col numbers
                    pos: { line: jslintError.line - 1, ch: jslintError.character - 1 },
                    message: jslintError.reason,
                    type: CodeInspection.Type.WARNING
                };
            });

            var result = { errors: errors };

            // If array terminated in a null it means there was a stop notice
            if (errors.length !== JSLINT.errors.length) {
                result.aborted = true;
                errors[errors.length - 1].type = CodeInspection.Type.META;
            }

            return result;
        }
        return null;
    }
1281051
function(blob) {
    if (blob.csslint && blob.csslint.length && blob.csslint[0].line !== undefined) {
      console.log('\nCSSLint reports issues in: '.red + blob.name);
      blob.csslint.forEach(function(i){
        if (i) {
          console.log(' Line ' + i.line + ', Col ' + i.col + ': ' + i.message);
        }
      });
    }
  }
396690
def _lint():
    """"""
    # Flake8 doesn't have an easy way to run checks using a Python function, so
    # just fork off another process to do it.

    # Python 3 compat:
    # - The result of subprocess call outputs are byte strings, meaning we need
    #   to pass a byte string to endswith.
    project_python_files = [filename for filename in get_project_files()
                            if filename.endswith(b'.py')]
    retcode = subprocess.call(
        ['flake8', '--max-complexity=10'] + project_python_files)
    if retcode == 0:
        print_success_message('No style errors')
    return retcode
125974
function isHtmlFileUptodate(source) {
    var dependencies = source.tag("dependencies") || [];
    var i, dep, file, prj = source.prj(),
    stat,
    mtime = source.modificationTime();
    for (i = 0 ; i < dependencies.length ; i++) {
        dep = dependencies[i];
        file = prj.srcOrLibPath(dep);
        if (file) {
            stat = FS.statSync(file);
            if (stat.mtime > mtime) return false;
        }
    }
    return source.isUptodate();
}
81545
function (req, res, lintErrors) {
  var html = template({
    lintErrors: lintErrors
  });
  res.end(html);
}
687555
function sassLoader(content) {
  const callback = this.async();
  const isSync = typeof callback !== 'function';
  const self = this;
  const { resourcePath } = this;

  function addNormalizedDependency(file) {
    // node-sass returns POSIX paths
    self.dependency(path.normalize(file));
  }

  if (isSync) {
    throw new Error(
      'Synchronous compilation is not supported anymore. See https://github.com/webpack-contrib/sass-loader/issues/333'
    );
  }

  let resolve = pify(this.resolve);

  // Supported since v4.27.0
  if (this.getResolve) {
    resolve = this.getResolve({
      mainFields: ['sass', 'main'],
      extensions: ['.scss', '.sass', '.css'],
    });
  }

  const options = normalizeOptions(
    this,
    content,
    webpackImporter(resourcePath, resolve, addNormalizedDependency)
  );

  // Skip empty files, otherwise it will stop webpack, see issue #21
  if (options.data.trim() === '') {
    callback(null, '');
    return;
  }

  const render = getRenderFuncFromSassImpl(
    // eslint-disable-next-line import/no-extraneous-dependencies, global-require
    options.implementation || getDefaultSassImpl()
  );

  render(options, (err, result) => {
    if (err) {
      formatSassError(err, this.resourcePath);

      if (err.file) {
        this.dependency(err.file);
      }

      callback(err);
      return;
    }

    if (result.map && result.map !== '{}') {
      // eslint-disable-next-line no-param-reassign
      result.map = JSON.parse(result.map);
      // result.map.file is an optional property that provides the output filename.
      // Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.
      // eslint-disable-next-line no-param-reassign
      delete result.map.file;
      // One of the sources is 'stdin' according to dart-sass/node-sass because we've used the data input.
      // Now let's override that value with the correct relative path.
      // Since we specified options.sourceMap = path.join(process.cwd(), "/sass.map"); in normalizeOptions,
      // we know that this path is relative to process.cwd(). This is how node-sass works.
      // eslint-disable-next-line no-param-reassign
      const stdinIndex = result.map.sources.findIndex(
        (source) => source.indexOf('stdin') !== -1
      );

      if (stdinIndex !== -1) {
        result.map.sources[stdinIndex] = path.relative(
          process.cwd(),
          resourcePath
        );
      }
      // node-sass returns POSIX paths, that's why we need to transform them back to native paths.
      // This fixes an error on windows where the source-map module cannot resolve the source maps.
      // @see https://github.com/webpack-contrib/sass-loader/issues/366#issuecomment-279460722
      // eslint-disable-next-line no-param-reassign
      result.map.sourceRoot = path.normalize(result.map.sourceRoot);
      // eslint-disable-next-line no-param-reassign
      result.map.sources = result.map.sources.map(path.normalize);
    } else {
      // eslint-disable-next-line no-param-reassign
      result.map = null;
    }

    result.stats.includedFiles.forEach(addNormalizedDependency);

    callback(null, result.css.toString(), result.map);
  });
}
156960
function polymerLint(args, ...patterns) {
  const bin = helpers.relativePath(process.env.NODE_PATH, 'bin/polymer-lint.js');
  return helpers.exec(`${bin} ${args} ${patterns.join(' ')}`);
}