<commit_before>'use strict'

const standard = require('standard')
const format = require('util').format
const assign = require('object-assign')
const loaderUtils = require('loader-utils')

module.exports = function standardLoader (text) {
  const self = this
  const callback = this.async()

  const config = assign(
    this.options.standard || {},
    loaderUtils.parseQuery(this.query)
  )

  this.cacheable()

  standard.lintText(text, config, function (err, result) {
    if (err) return callback(err, text)
    if (result.errorCount === 0) return callback(err, text)

    const warnings = result.results.reduce(function (items, result) {
      return items.concat(result.messages.map(function (message) {
        return format(
          '%s:%d:%d: %s',
          result.filePath, message.line || 0, message.column || 0, message.message
        )
      }))
    }, [])

    self.emitWarning(warnings.join('\n'))
    callback(err, text)
  })
}
<commit_msg>Remove const in strict-mode for 0.10.x.<commit_after>'use strict'

var standard = require('standard')
var format = require('util').format
var assign = require('object-assign')
var loaderUtils = require('loader-utils')

module.exports = function standardLoader (text) {
  var self = this
  var callback = this.async()

  var config = assign(
    this.options.standard || {},
    loaderUtils.parseQuery(this.query)
  )

  this.cacheable()

  standard.lintText(text, config, function (err, result) {
    if (err) return callback(err, text)
    if (result.errorCount === 0) return callback(err, text)

    var warnings = result.results.reduce(function (items, result) {
      return items.concat(result.messages.map(function (message) {
        return format(
          '%s:%d:%d: %s',
          result.filePath, message.line || 0, message.column || 0, message.message
        )
      }))
    }, [])

    self.emitWarning(warnings.join('\n'))
    callback(err, text)
  })
}

{'fraction_non_alphanumeric': 0.1461139896373057, 'fraction_numerical': 0.00466321243523316, 'mean_word_length': 3.349099099099099, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '28202', 'n_tokens_mistral': 590, 'n_tokens_neox': 573, 'n_words': 139}