<commit_before><?php

/**
 * Uses "flake8" to detect various errors in Python code.
 * Requires version 1.7.0 or newer of flake8.
 */
final class ArcanistFlake8Linter extends ArcanistExternalLinter {

  public function getInfoName() {
    return 'Flake8';
  }

  public function getInfoURI() {
    return 'https://pypi.python.org/pypi/flake8';
  }

  public function getInfoDescription() {
    return pht(
      'Uses `flake8` to run several linters (PyFlakes, pep8, and a McCabe '.
      'complexity checker) on Python source files.');
  }

  public function getLinterName() {
    return 'flake8';
  }

  public function getLinterConfigurationName() {
    return 'flake8';
  }

  public function getDefaultFlags() {
    return $this->getDeprecatedConfiguration('lint.flake8.options', array());
  }

  public function getDefaultBinary() {
    $prefix = $this->getDeprecatedConfiguration('lint.flake8.prefix');
    $bin = $this->getDeprecatedConfiguration('lint.flake8.bin', 'flake8');

    if ($prefix) {
      return $prefix.'/'.$bin;
    } else {
      return $bin;
    }
  }

  public function getVersion() {
    list($stdout) = execx('%C --version', $this->getExecutableCommand());

    $matches = array();
    if (preg_match('/^(?P<version>\d+\.\d+\.\d+)\b/', $stdout, $matches)) {
      return $matches['version'];<commit_msg>Relax the version regex for `ArcanistFlake8Linter`.<commit_after><?php

/**
 * Uses "flake8" to detect various errors in Python code.
 * Requires version 1.7.0 or newer of flake8.
 */
final class ArcanistFlake8Linter extends ArcanistExternalLinter {

  public function getInfoName() {
    return 'Flake8';
  }

  public function getInfoURI() {
    return 'https://pypi.python.org/pypi/flake8';
  }

  public function getInfoDescription() {
    return pht(
      'Uses `flake8` to run several linters (PyFlakes, pep8, and a McCabe '.
      'complexity checker) on Python source files.');
  }

  public function getLinterName() {
    return 'flake8';
  }

  public function getLinterConfigurationName() {
    return 'flake8';
  }

  public function getDefaultFlags() {
    return $this->getDeprecatedConfiguration('lint.flake8.options', array());
  }

  public function getDefaultBinary() {
    $prefix = $this->getDeprecatedConfiguration('lint.flake8.prefix');
    $bin = $this->getDeprecatedConfiguration('lint.flake8.bin', 'flake8');

    if ($prefix) {
      return $prefix.'/'.$bin;
    } else {
      return $bin;
    }
  }

  public function getVersion() {
    list($stdout) = execx('%C --version', $this->getExecutableCommand());

    $matches = array();
    if (preg_match('/^(?P<version>\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) {
      return $matches['version'];
{'fraction_non_alphanumeric': 0.15072035463612857, 'fraction_numerical': 0.012190616919098634, 'mean_word_length': 3.4908789386401327, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '3420314', 'n_tokens_mistral': 897, 'n_tokens_neox': 868, 'n_words': 204}