diff --git a/arcanist/linter/ShellLocaleLinter.php b/arcanist/linter/ShellLocaleLinter.php index c8170c2f31..458250ab74 100644 --- a/arcanist/linter/ShellLocaleLinter.php +++ b/arcanist/linter/ShellLocaleLinter.php @@ -1,56 +1,59 @@ ArcanistLintSeverity::SEVERITY_ERROR, ); } public function getLintNameMap() { return array( - self::INVALID_LOCALE => pht('`'.self::LOCALE_STATEMENT.'` should be '. - 'the first statement.'), + self::INVALID_LOCALE => pht( + '`'.join('` or `', self::LOCALE_STATEMENTS).'` should be '. + 'the first statement.'), ); } public function lintPath($path) { $absPath = Filesystem::resolvePath($path, $this->getProjectRoot()); $fileContent = Filesystem::readFile($absPath); if (!preg_match_all('/^[^#\s]+.+/m', $fileContent, $matches)) { throw new Exception(pht('Error while parsing %s: the script seems to '. 'have only comments and/or empty lines.', $path)); } - if (!(trim($matches[0][0]) === self::LOCALE_STATEMENT)) { + if (array_search(trim($matches[0][0]), + self::LOCALE_STATEMENTS, true) === false) { return $this->raiseLintAtPath( self::INVALID_LOCALE, pht('Shell scripts should set the locale to avoid side effects.') ); } } }