diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ } ``` +**OPTIONS** + +Please see `arc linters shellcheck` for the list of options supported by this +linter. + **TIPS** As Arcanist currently doesn't detect file formats or doesn't parse diff --git a/lint/linter/ArcanistShellCheckLinter.php b/lint/linter/ArcanistShellCheckLinter.php --- a/lint/linter/ArcanistShellCheckLinter.php +++ b/lint/linter/ArcanistShellCheckLinter.php @@ -3,6 +3,7 @@ final class ArcanistShellCheckLinter extends ArcanistExternalLinter { private $shell; + private $exclude; public function getInfoName() { return 'ShellCheck'; @@ -37,6 +38,10 @@ 'ksh', 'zsh'), ), + 'shellcheck.exclude' => array( + 'type' => 'optional list', + 'help' => pht('Specify excluded checks, e.g.: SC2035.'), + ), ); return $options + parent::getLinterConfigurationOptions(); @@ -48,6 +53,10 @@ $this->setShell($value); return; + case 'shellcheck.exclude': + $this->setExclude($value); + return; + default: return parent::setLinterConfigurationValue($key, $value); } @@ -58,6 +67,11 @@ return $this; } + public function setExclude($exclude) { + $this->exclude = $exclude; + return $this; + } + public function getDefaultBinary() { return 'shellcheck'; } @@ -77,6 +91,12 @@ $options[] = '--shell='.$this->shell; } + if ($this->exclude) { + foreach ($this->exclude as $code) { + $options[] = '--exclude='.$code; + } + } + return $options; }