return $config->getConfigFromAnySource('lint.csslint.bin', 'csslint');
}
+ public function getVersion() {
+ list($stdout) = execx('%C --version', $this->getExecutableCommand());
+
+ $matches = array();
+ if (preg_match('/^v(?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) {
+ return $matches['version'];
+ } else {
+ return false;
+ }
+ }
+
public function getInstallInstructions() {
return pht('Install CSSLint using `npm install -g csslint`.');
}
return array_merge($mandatory_flags, $flags);
}
+ public function getCacheVersion() {
+ $version = $this->getVersion();
+
+ if ($version) {
+ return $version.'-'.json_encode($this->getCommandFlags());
+ } else {
+ // Either we failed to parse the version number or the `getVersion`
+ // function hasn't been implemented.
+ return json_encode($this->getCommandFlags());
+ }
+ }
+
+ public function getVersion() {
+ return null;
+ }
protected function buildFutures(array $paths) {
$executable = $this->getExecutableCommand();
return 'flake8';
}
+ 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'];
+ } else {
+ return false;
+ }
+ }
+
public function getInstallInstructions() {
return pht('Install flake8 using `easy_install flake8`.');
}
}
}
- public function getCacheVersion() {
+ public function getVersion() {
list($stdout) = execx('%C --version', $this->getExecutableCommand());
- // Extract version number from standard output.
$matches = array();
- if (preg_match('/^jshint v(\d+\.\d+\.\d+)$/', $stdout, $matches)) {
- $version = $matches[1];
+ $regex = '/^jshint v(?P<version>\d+\.\d+\.\d+)$/';
+ if (preg_match($regex, $stdout, $matches)) {
+ return $matches['version'];
} else {
- $version = md5($stdout);
+ return false;
}
-
- return $version . '-' . md5(json_encode($this->getCommandFlags()));
}
public function getInstallInstructions() {
return 'pep8';
}
- public function getCacheVersion() {
- list($stdout) = execx('%C --version', $this->getExecutableCommand());
- return $stdout.implode(' ', $this->getCommandFlags());
- }
-
public function getDefaultFlags() {
// TODO: Warn that all of this is deprecated.
$config = $this->getEngine()->getConfigurationManager();
return $arc_root.'/externals/pep8/pep8.py';
}
+ public function getVersion() {
+ list($stdout) = execx('%C --version', $this->getExecutableCommand());
+
+ $matches = array();
+ if (preg_match('/^(?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) {
+ return $matches['version'];
+ } else {
+ return false;
+ }
+ }
+
public function getInstallInstructions() {
return pht('Install PEP8 using `easy_install pep8`.');
}
return $config->getConfigFromAnySource('lint.phpcs.bin', 'phpcs');
}
+ public function getVersion() {
+ list($stdout) = execx('%C --version', $this->getExecutableCommand());
+
+ $matches = array();
+ $regex = '/^PHP_CodeSniffer version (?P<version>\d+\.\d+\.\d+)\b/';
+ if (preg_match($regex, $stdout, $matches)) {
+ return $matches['version'];
+ } else {
+ return false;
+ }
+ }
+
public function shouldExpectCommandErrors() {
return true;
}
return 'ruby';
}
+ public function getVersion() {
+ list($stdout) = execx('%C --version', $this->getExecutableCommand());
+
+ $matches = array();
+ $regex = '/^ruby (?P<version>\d+\.\d+\.\d+)p\d+/';
+ if (preg_match($regex, $stdout, $matches)) {
+ return $matches['version'];
+ } else {
+ return false;
+ }
+ }
+
public function getInstallInstructions() {
return pht('Install `ruby` from <http://www.ruby-lang.org/>.');
}