Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/DiffusionLintSaveRunner.php
| Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | private function runArcLint(array $files) { | ||||
| try { | try { | ||||
| $future = new ExecFuture( | $future = new ExecFuture( | ||||
| '%C lint --severity %s --output json %Ls', | '%C lint --severity %s --output json %Ls', | ||||
| $this->arc, | $this->arc, | ||||
| $this->severity, | $this->severity, | ||||
| $files); | $files); | ||||
| foreach (new LinesOfALargeExecFuture($future) as $json) { | foreach (new LinesOfALargeExecFuture($future) as $json) { | ||||
| $paths = json_decode($json, true); | $paths = null; | ||||
| if (!is_array($paths)) { | try { | ||||
| fprintf(STDERR, "Invalid JSON: {$json}\n"); | $paths = phutil_json_decode($json); | ||||
| } catch (PhutilJSONParserException $ex) { | |||||
| fprintf(STDERR, pht("Invalid JSON: %s\n", $json)); | |||||
| continue; | continue; | ||||
| } | } | ||||
| foreach ($paths as $path => $messages) { | foreach ($paths as $path => $messages) { | ||||
| if (!isset($files[$path])) { | if (!isset($files[$path])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines | |||||