Provides Stylelint result to reporters.
@param {[Object]} lintResults - Stylelint results.
@return {Promise} Resolved with original lint results.
169885
function passLintResultsThroughReporters(lintResults) {
    const warnings = lintResults
      .reduce((accumulated, res) => accumulated.concat(res.results), []);

    return Promise
      .all(reporters.map(reporter => reporter(warnings)))
      .then(() => lintResults);
  }
449175
function ASemantics(matchResult) {
    if (!(matchResult instanceof MatchResult)) {
      throw new TypeError(
          'Semantics expected a MatchResult, but got ' + common.unexpectedObjToString(matchResult));
    }
    if (matchResult.failed()) {
      throw new TypeError('cannot apply Semantics to ' + matchResult.toString());
    }

    var cst = matchResult._cst;
    if (cst.grammar !== grammar) {
      throw new Error(
          "Cannot use a MatchResult from grammar '" + cst.grammar.name +
          "' with a semantics for '" + grammar.name + "'");
    }
    var inputStream = new InputStream(matchResult.input);
    return s.wrap(cst, inputStream.interval(matchResult._cstOffset, matchResult.input.length));
  }
551189
function firstResult(items, fn) {
	for (const item of items) {
		if (!item) {
			continue;
		}

		const result = fn(item);
		if (result) {
			return result;
		}
	}
	return undefined;
}
261918
function(styles) {

	var computedStyles = document.defaultView.getComputedStyle(this._node),
		i,
		eachStyle,
		cssMap = {}

	// String case, just return the correct style
	if (typeof styles == "string") {
		return computedStyles[styles]
	}

	for (i=0; eachStyle = styles[i]; i++) {
		cssMap[eachStyle] = computedStyles[eachStyle]
	}
	return cssMap
}
987572
def lint_javascript(context: Context):
    
    args = [
        '--config', os.path.join(context.app.common_templates_path, 'mtp_common', 'build_tasks', 'eslintrc.json'),
        '--format', 'stylish',
    ]
    if context.verbosity == 0:
        args.append('--quiet')
    if not context.use_colour:
        args.append('--no-color')
    args.append(context.app.javascript_source_path)
    return context.node_tool('eslint', *args)
748312
def _handleLegacyResult(result):
    
    if not isinstance(result, dict):
        warnings.warn('The Gerrit status callback uses the old way to '
                      'communicate results.  The outcome might be not what is '
                      'expected.')
        message, verified, reviewed = result
        result = makeReviewResult(message,
                                  (GERRIT_LABEL_VERIFIED, verified),
                                  (GERRIT_LABEL_REVIEWED, reviewed))
    return result
1042999
function resolveStylesheet(file, pathes) {
    var filePath = file.path,
        linkStr = '';

    for(var i = 0, len = pathes.length; i < len; i ++) {
        linkStr += '<link rel="stylesheet" href="' + path.relative(path.dirname(filePath), pathes[i]) + '"/>\r\n';
    }

    return linkStr;
}
1328372
function(results) {
        if (results) {
            var isRows = !!results.rows;
            var numResults = (results.rows ? results.rows.length : (results.columns[0] || []).length);
            
            console.log("====== " + numResults + " RESULTS (preview: " + !!results.preview + ") ======");
            
            // If it is in column-major form, transpose it.
            if (!isRows) {
                results = transpose(results);
            }
            
            printRows(results);
        }
    }
912755
function errorOrResult(error, result, fn) {
        return error ? fn(error) : fn(null, result);
    }
1084715
function lint() {
    return gulp.src(srcDir + '**/*.js')
        .pipe($$.excludeGitignore())
        .pipe($$.eslint())
        .pipe($$.eslint.format())
        .pipe($$.eslint.failAfterError());
}
1189603
function lint() {
  var errorsFound = false;
  var stream = gulp.src(config.lintGlobs);

  if (isWatching) {
    stream = stream.pipe(watcher());
  }

  if (argv.fix) {
    options.fix = true;
  }

  return stream.pipe(eslint(options))
    .pipe(eslint.formatEach('stylish', function(msg) {
      errorsFound = true;
      util.log(util.colors.red(msg));
    }))
    .pipe(gulpIf(isFixed, gulp.dest('.')))
    .pipe(eslint.failAfterError())
    .on('end', function() {
      if (errorsFound && !options.fix) {
        util.log(util.colors.blue('Run `gulp lint --fix` to automatically ' +
            'fix some of these lint warnings/errors. This is a destructive ' +
            'operation (operates on the file system) so please make sure ' +
            'you commit before running.'));
      }
    });
}
55395
function lint(input, options, webpack, callback) {
  // Run sassLint
  var report = sassLint.lintText({
    'text': input,
    'format': path.extname(webpack.resourcePath).replace('.',  ''),
    'filename': path.relative(process.cwd(), webpack.resourcePath)
  }, {}, options.configFile);

  if (report.messages.length) {
    
    if (report.warningCount && options.quiet) {
      report.warningCount = 0;
      report.messages = report.messages
        .filter(function(message) {
          return message.severity !== 1;
        });
    }

    if (report.errorCount || report.warningCount) {
      var messages = formatter(report.messages, webpack.resourcePath);

      // Default emitter behavior
      var emitter = report.errorCount ? webpack.emitError : webpack.emitWarning;

      // Force emitError or emitWarning by setting option
      if (options.emitError) {
        emitter = webpack.emitError;
      } else if (options.emitWarning) {
        emitter = webpack.emitWarning;
      }

      if (emitter) {
        emitter(messages);
        if (options.failOnError && report.errorCount) {
          throw new Error('Module failed because of a sasslint error.\n' + messages);
        } else if (options.failOnWarning && report.warningCount) {
          throw new Error('Module failed because of a sasslint warning.\n' + messages);
        }
      } else {
        throw new Error(
          'Your module system doesn\'t support emitWarning.' +
          'Update available? \n' +
          messages
        );
      }
    }
  }

  if (callback) {
    callback(null, input);
  }
}
115451
function getResults(result, objects) {
		
		// if there are no results, resolve an empty array
		if (!result) {
			return new Promise(function(resolve, reject) {
				resolve([]);
			});
		}
		
		// if the result object is undefined or not an array, make it one
		result.objects = result.objects || [];
		result.objects = Array.isArray(result.objects) ? result.objects : [result.objects];
		objects        = _.union(objects, result.objects);
		
		// if the result has a token, there are more results, continue to get them
		if (result.token) {
			return _client.method('ContinueRetrievePropertiesEx', {
				_this: _client._sc.propertyCollector,
				token: result.token
			})
			.then(function(results) {
				return getResults(results, objects);
			});
		}
		
		// if there are no more results, return the formatted results
		else {
			return new Promise(function(resolve, reject) {
				resolve(env.format(objects));
			});
		}
	}
1004189
function lintFileContents (messages, js) {
  // what was messages imported as
  let importedAtRootAs = false
  let importedMembersAs
  const importedMembersLookup = new Map()

  let namedMatcher, rootMatcher

  // TODO handle importing members, e.g. import { analysis } from messages

  const foundMessages = []

  let lineNumber = 0 // first increment lands at 0

  for (const line of js.split('\n')) {
    lineNumber++
    const parsedImport = parseImportLine(line)
    if (parsedImport) {
      ;[importedAtRootAs, importedMembersAs] = parsedImport
      // make sure we don't catch things like display_messages by making sure there's a diff char before
      rootMatcher = new RegExp(
        `[^a-zA-Z0-9_$]${importedAtRootAs}\\.([^ ,\\(\\)\\[}]+)`,
        'g'
      )
      namedMatcher = new RegExp(
        `[^a-zA-Z0-9_$](${importedMembersAs
          .map(a => a[1])
          .join('|')})\\.([^ ,\\(\\)\\[}]+)`,
        'g'
      )
      importedMembersAs.forEach(([member, importedAs]) =>
        importedMembersLookup.set(importedAs, member)
      )
    } else if (importedAtRootAs || importedMembersAs) {
      let result
      // each subsequent call gets next match
      if (importedAtRootAs) {
        while ((result = rootMatcher.exec(line)) != null) {
          foundMessages.push([result[1], lineNumber])
        }
      }

      // do the same for imported members
      if (importedMembersAs.length > 0) {
        while ((result = namedMatcher.exec(line)) != null) {
          // map back to the names in the messages file
          foundMessages.push([
            `${importedMembersLookup.get(result[1])}.${result[2]}`,
            lineNumber
          ])
        }
      }
    }
  }

  // filter to only the missing ones
  return foundMessages.filter(([message, lineNumber]) => {
    let current = messages
    for (const sub of message.split('.')) {
      current = current[sub]
      if (current == null) {
        return true // something in the chain is undefined
      }
    }

    return false
  })
}
221443
function activatePostCSSPlugins(config) {
  const plugins = [];

  if (config.lintRules || config.lintRules !== "") {
    // TODO: Throw easy-to-understand error message
    // incorrect path? (ex. "lintRules": "aaa")
    // typo? (ex. "lintRules": "stylelint-config-suitcs")
    const lintRules = require(config.lintRules);

    if (lintRules.rules) {
      plugins.push(stylelint(lintRules));
    } else {
      throw new Error("Illegal lint rule: \"rules\" property is not found.");
    }
  }

  if (config.browsers && config.browsers !== "") {
    plugins.push(autoprefixer(config.browsers));
  }

  plugins.push(cssfmt);
  plugins.push(reporter);

  return plugins;
}
10887
async function parseReport() { // eslint-disable-line no-unused-vars
  try {
    const coverage = await promises.readFile('lcov.info', 'utf8');
    const report = Report.fromCoverage(coverage);
    console.log(`The coverage report contains ${report.records.length} records:`);
    console.log(report.toJSON());
  }

  catch (error) {
    console.log(`An error occurred: ${error.message}`);
  }
}
104963
function lintFiles (src)
{
    gulp.src(src)
        .pipe(scssLint({
            config: __dirname + "/../config/scss-lint.yml",
            customReport: issueCountReporter
        }))
        .on('error', function (error)
        {
            gulpUtil.log(gulpUtil.colors.red('An error has occurred while executing scss-lint: ' + error.message));
        })
        .on('end', reportTotalIssueCount);
}