return 'generated';
}
+ protected function canCustomizeLintSeverities() {
+ return false;
+ }
+
public function lintPath($path) {
$data = $this->getData($path);
if (preg_match('/@'.'generated/', $data)) {
}
public function getLinterConfigurationOptions() {
+ if (!$this->canCustomizeLintSeverities()) {
+ return array();
+ }
+
return array(
'severity' => 'optional map<string|int, string>',
'severity.rules' => 'optional map<string, string>',
switch ($key) {
case 'severity':
+ if (!$this->canCustomizeLintSeverities()) {
+ break;
+ }
+
$custom = array();
foreach ($value as $code => $severity) {
if (empty($sev_map[$severity])) {
$this->setCustomSeverityMap($custom);
return;
+
case 'severity.rules':
+ if (!$this->canCustomizeLintSeverities()) {
+ break;
+ }
+
foreach ($value as $rule => $severity) {
if (@preg_match($rule, '') === false) {
throw new Exception(
throw new Exception("Incomplete implementation: {$key}!");
}
+ protected function canCustomizeLintSeverities() {
+ return true;
+ }
+
protected function shouldLintBinaryFiles() {
return false;
}
return 'nolint';
}
+ protected function canCustomizeLintSeverities() {
+ return false;
+ }
+
public function lintPath($path) {
$data = $this->getData($path);
if (preg_match('/@'.'nolint/', $data)) {