Page MenuHomePhabricator

D9026.id21487.diff
No OneTemporary

D9026.id21487.diff

diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php
--- a/src/lint/linter/ArcanistExternalLinter.php
+++ b/src/lint/linter/ArcanistExternalLinter.php
@@ -385,6 +385,19 @@
return null;
}
+ /**
+ * Prepare the path to be added to the command string
+ *
+ * This method is expected to return an already escaped string.
+ *
+ * @param string Path to the file being linted
+ *
+ * @return string The command-ready file argument
+ */
+ protected function getPathArgumentForLinterFuture($path) {
+ return csprintf('%s', $path);
+ }
+
protected function buildFutures(array $paths) {
$executable = $this->getExecutableCommand();
@@ -393,15 +406,14 @@
$futures = array();
foreach ($paths as $path) {
if ($this->supportsReadDataFromStdin()) {
- $future = new ExecFuture(
- '%C %C',
- $bin,
+ $future = new ExecFuture('%C %C', $bin,
$this->getReadDataFromStdinFilename());
$future->write($this->getEngine()->loadData($path));
} else {
// TODO: In commit hook mode, we need to do more handling here.
$disk_path = $this->getEngine()->getFilePathOnDisk($path);
- $future = new ExecFuture('%C %s', $bin, $disk_path);
+ $path_argument = $this->getPathArgumentForLinterFuture($disk_path);
+ $future = new ExecFuture('%C %C', $bin, $path_argument);
}
$futures[$path] = $future;

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 9:15 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224531
Default Alt Text
D9026.id21487.diff (1 KB)

Event Timeline