Lint project scripts.

@param {ConfigParser} conf A configuration parser object.
@param {Undertaker} undertaker An Undertaker instance.

@returns {Stream} A stream of files.
503717
function lintScripts(conf, undertaker) {

  const jsSrc = path.join(conf.themeConfig.root, conf.themeConfig.js.src, '**', '*.js');

  // Lint theme scripts with ESLint. This won't touch any TypeScript files.
  return undertaker.src(jsSrc)
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(gulpIf(conf.productionMode, eslint.failAfterError()));

}
399629
function ConfigFromPath (superConfig, project, version) {
  ConfigFromPath.super_.call(this, superConfig, project, version);

  var strictNS = simpleWrapNS(this.ns);
  strictNS.env = simpleWrapNS(createNamespace(superConfig.getEnvConfig()));

  var files = superConfig._resolvePaths(project, version);
  var loaded = {};

  var generateLoad = function (f) {
    return function (otherVersion) {
      debug('load(%s) in %s', otherVersion, f);
      var dir = path.dirname(f);
      var otherFile = path.resolve(dir, otherVersion + '.js');
      if (loaded[otherFile]) {
        throw new Error('load(' + version + ') conflict in file ' + f);
      }
      try {
        require(otherFile)(strictNS, generateLoad(otherFile));
      } catch (err) {
        if (err.code === 'MODULE_NOT_FOUND') {
          throw new Error('load(' + version + ') fail in file ' + f);
        } else {
          throw err;
        }
      }
    };
  };
  files.forEach(function (f) {
    debug('load %s', f);
    var init = require(f);
    loaded[f] = true;
    if (typeof init !== 'function') {
      throw new Error('bad config file format, `module.exports` must be a function: ' + f);
    }
    init(strictNS, generateLoad(f));
  });

  var loadedFiles = Object.keys(loaded);
  if (loadedFiles.length < 1) {
    throw new Error('cannot find any config files for ' + project + '.' + version);
  } else {
    loadedFiles.forEach(function (f) {
      delete require.cache[f];
    });
  }

  this._loadFinish();
  debug('done');
}
56159
function lintAllFiles (src, options)
{
    glob(src,
        function (err, files)
        {
            if (err) throw err;

            for (var i = 0, l = files.length; i < l; i++)
            {
                jsHintHelper.lintFile(files[i], options.rules);
            }
        }
    );
}
939724
function toJSON (file, config) {
  if (Path.extname(file.path) === '.json') {
    if (!isJSON(file)) file.isInvalid = true;
    return Promise.resolve(file);
  }

  let jsonFile = file.clone();

  return Promise.resolve(file)
    // parse YAML
    .then(file => {
      try {
        let parsed = frontmatter(file.contents.toString());
        return Promise.resolve(parsed);
      } catch (err) {
        return Promise.reject(err);
      }
    // parse and render Markdown
    }).then(parsed => {
      try {
        let data = parsed.attributes;
        data.body = config.renderer.call(config.context, parsed.body);
        return Promise.resolve(data);
      } catch (err) {
        return Promise.reject(err);
      }
    // optional transforms and output
    }).then(data => {
      if (!data.title) {
        let extracted = extractTitle(data.body, config.stripTitle);
        if (typeof extracted === 'object') data = assign(data, extracted);
      }

      data.updatedAt = file.stat.mtime.toISOString();

      if (config.transform) var transformedData = config.transform(data, file);

      jsonFile.extname = '.json';
      jsonFile.contents = new Buffer(JSON.stringify(transformedData || data));

      return Promise.resolve(jsonFile);
    });
}
171500
function startWatcherForLinting (src)
{
    watch(src,
        function (file)
        {
            if (file.path)
            {
                lintFiles(file.path);
            }
        }
    );
}
510024
def lint_file(file_path):
    

    with open(file_path, 'r') as yaml:
        try:
            return lint(yaml)
        except Exception as e:
            lr = LintResult()
            lr.add_error('could not parse YAML: %s' % e, exception=e)
            return lr
109317
function parseForESLint(code, options) {
    const opts = options || {}
    if (!isHtmlFile(code, opts)) {
        return parseScript(code, opts)
    }
    return parseTemplate(code, opts)
}
1151685
function parseFile (filePath, fileContent) {
  let config = null
  const extension = path.extname(filePath)

  if (extension === '.yml' || extension === '.yaml') {
    config = yaml.safeLoad(replaceEnvironmentVariables(fileContent))
  } else if (extension === '.js') {
    config = require(path.resolve(filePath)) // eslint-disable-line
  } else if (extension === '.json') {
    config = JSON.parse(replaceEnvironmentVariables(fileContent))
  } else {
    throw new Error(`${extension} is not supported as configuration file`)
  }

  return config
}
1370892
function getVcl(conf) {
  const config = _.extend({
    version: new Date().toISOString(),
    timeout: defaultTimeout,
    urlPassList: ['cache-control=no-cache'],
    hash: [
      'req.url',
      [
        'req.http.host',
        'server.ip',
      ],
    ],
    hisForPassTTL: 120,
  }, conf);
  /* istanbul ignore if */
  if (!config.directors || !config.name) {
    throw new Error('directors, name can not be null');
  }
  if (!config.directors.length) {
    throw new Error('directors can not be empty');
  }
  if (config.name === '$HOSTNAME') {
    config.name = os.hostname();
  } else if (config.name[0] === '$') {
    config.name = process.env[config.name.substring(1)];
  }
  _.forEach(config.directors, (item) => {
    if (!item.timeout) {
      /* eslint no-param-reassign:0 */
      item.timeout = config.timeout;
    }
    if (item.type === 'shard') {
      throw new Error('shard director is not support');
    }
  });
  const cloneConfig = _.extend({
    stale: 3,
    varnish: '5',
    hashConfig: getHash(config.hash),
    passRules: getPassRules(config.urlPassList),
  }, config);
  return getConfig(cloneConfig.directors).then((data) => {
    _.extend(cloneConfig, data);
    return readFilePromise(path.join(__dirname, 'template/varnish.tpl'));
  }).then(tpl => _.template(tpl)(cloneConfig));
}
1084715
function lint() {
    return gulp.src(srcDir + '**/*.js')
        .pipe($$.excludeGitignore())
        .pipe($$.eslint())
        .pipe($$.eslint.format())
        .pipe($$.eslint.failAfterError());
}
546278
def collect_lints(file, linter_selector, config)
      begin
        document = HamlLint::Document.new(File.read(file), file: file, config: config)
      rescue HamlLint::Exceptions::ParseError => e
        return [HamlLint::Lint.new(HamlLint::Linter::Syntax.new(config), file,
                                   e.line, e.to_s, :error)]
      end

      linter_selector.linters_for_file(file).map do |linter|
        linter.run(document)
      end.flatten
    end
469220
function lint (files) {
  const stream = gulp.src(files)
  .pipe($.plumber())
  .pipe($.eslint())
  .pipe($.eslint.format())
  if (process.env.NODE_ENV === 'production') {
    stream.pipe($.eslint.failOnError())
  }
  stream.on('error', onError)
  return stream
}
1114061
def run_linter(linter, engine, file_path)
      return if @config.excluded_file_for_linter?(file_path, linter)
      @lints += linter.run(engine, @config.linter_options(linter))
    end
455216
function simpleStream(config, transforms) {
  if (!Array.isArray(transforms)) {
    transforms = []
  }

  // check that we have a valid config
  let err = null
  if (!isObject(config)) {
    err = `missing config object, received '${typeof config}'`
  } else {
    const { dest, src } = config
    if (typeof dest !== 'string' && typeof dest !== 'function') {
      err = `expected a string or function for 'dest' property in config`
    } else if (!Array.isArray(src) && typeof src !== 'string') {
      err = `expected a string or array for 'src' property in config`
    }
  }
  if (err != null) {
    throw new Error(`${err}\n${JSON.stringify(config, null, 2)}`)
  }

  // create plumbed stream
  let stream = gulp
    .src(config.src, { allowEmpty: !options.strict })
    .pipe(catchErrors())

  // init sourcemaps
  if (config.sourcemaps) {
    stream = stream.pipe(sourcemaps.init())
  }

  // insert transforms in the middle
  for (const transform of transforms.filter(isStream)) {
    stream = stream.pipe(transform)
  }

  // log file sizes
  stream = stream.pipe(
    showSizes(typeof config.dest === 'string' ? config.dest + '/' : undefined)
  )

  // generate sourcemaps
  if (config.sourcemaps) {
    stream = stream.pipe(
      sourcemaps.write(
        typeof config.sourcemaps === 'string' ? config.sourcemaps : '.'
      )
    )
  }

  // write files
  return stream.pipe(gulp.dest(config.dest))
}
352143
function lintJS (args = []) {
  if (!Array.isArray(args)) {
    throw new TypeError('arguments has to be an array')
  }

  const command = [
    `node ${resolveBin('eslint')}`,
    '--format codeframe',
    '"src/**/*.js"',
    ...args
  ].join(' ')

  console.log(chalk`\nCommand:\n{green ${command}}\n`)

  try {
    execSync(command, { stdio: 'inherit' })
  } catch (error) {
    return false
  }

  return true
}
943152
def parse(self, stream):
        """"""
        yaml = self._load_yaml()

        try:
            parsed_obj = yaml.safe_load(stream)
        except Exception as e:
            raise ConfigFileParserException("Couldn't parse config file: %s" % e)

        if not isinstance(parsed_obj, dict):
            raise ConfigFileParserException("The config file doesn't appear to "
                "contain 'key: value' pairs (aka. a YAML mapping). "
                "yaml.load('%s') returned type '%s' instead of 'dict'." % (
                getattr(stream, 'name', 'stream'),  type(parsed_obj).__name__))

        result = OrderedDict()
        for key, value in parsed_obj.items():
            if isinstance(value, list):
                result[key] = value
            else:
                result[key] = str(value)

        return result
400946
function (args, callback) {
        var query =
          {
            type: "lint",  //$NON-NLS-1$
            file: args.meta.location,
            config: args.config
          };
        ternserver.request(
          {
            query: query,
            files: args.files
          },
          function (error, problems) {
            if (error) {
              callback({request: 'lint', error: error.message, message: Messages['failedToComputeProblems']}); //$NON-NLS-1$
            } else if (problems && Array.isArray(problems)) {
              callback({request: 'lint', problems: problems}); //$NON-NLS-1$
            } else {
              callback({request: 'lint', problems: []}); //$NON-NLS-1$
            }
          });
      }