There are multiple sources (https://secure.phabricator.com/diffusion/ARC/browse/master/src/lint/linter/ArcanistScriptAndRegexLinter.php, https://secure.phabricator.com/book/phabricator/article/arcanist_lint_script_and_regex/) describing how to use the script-and-regex linter. The sources say that the file path is passed as first argument to the script and can therefore be used as $0 in the script definition.
Reproduction steps:
- Create linter configuration
{ "linters": { "sass": { "type": "script-and-regex", "include": "(\\.s+(a|c)ss$)", "script-and-regex.script": "sass-lint -v -q --format=compact \"$0\" || true", "script-and-regex.regex": "/^(?P<file>.*): line (?P<line>[0-9]*), col (?P<char>[0-9]*), (?P<warning>Warning|Error) - (?P<message>.*)$/m" } } }
- create a foo.sass sass file and add some content
- run arc lint
Expected result:
The linter will be called and the filename will be passes as first arguemnt to the defined script-and-regex.script
sass-lint -v -q --format=compact "foo.sass" || true
Actual result:
The file is appended to the script path.
sass-lint -v -q --format=compact "" || true foo.sass
The problem is, that the lint command is build like this:
$future = new ExecFuture('%C %s', $this->script, $path);