diff --git a/arcanist/linter/ShellLocaleLinter.php b/arcanist/linter/ShellLocaleLinter.php --- a/arcanist/linter/ShellLocaleLinter.php +++ b/arcanist/linter/ShellLocaleLinter.php @@ -1,19 +1,20 @@ pht('`'.self::LOCALE_STATEMENT.'` should be '. - 'the first statement.'), + self::INVALID_LOCALE => pht( + '`'.join('` or `', self::LOCALE_STATEMENTS).'` should be '. + 'the first statement.'), ); } @@ -46,11 +48,16 @@ 'have only comments and/or empty lines.', $path)); } - if (!(trim($matches[0][0]) === self::LOCALE_STATEMENT)) { - return $this->raiseLintAtPath( - self::INVALID_LOCALE, - pht('Shell scripts should set the locale to avoid side effects.') - ); + $firstMatch = trim($matches[0][0]); + foreach(self::LOCALE_STATEMENTS as $statement) { + if ($firstMatch === $statement) { + return; + } } + + return $this->raiseLintAtPath( + self::INVALID_LOCALE, + pht('Shell scripts should set the locale to avoid side effects.') + ); } }