Changeset View
Changeset View
Standalone View
Standalone View
src/lint/engine/ArcanistLintEngine.php
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | final private function isRelevantMessage(ArcanistLintMessage $message) { | ||||
$locations = $message->getOtherLocations(); | $locations = $message->getOtherLocations(); | ||||
$locations[] = $message->toDictionary(); | $locations[] = $message->toDictionary(); | ||||
foreach ($locations as $location) { | foreach ($locations as $location) { | ||||
$path = idx($location, 'path', $message->getPath()); | $path = idx($location, 'path', $message->getPath()); | ||||
if (!array_key_exists($path, $this->changedLines)) { | if (!array_key_exists($path, $this->changedLines)) { | ||||
if (phutil_is_windows()) { | |||||
// We try checking the UNIX path form as well, on Windows. Linters | |||||
// store noramlized paths, which use the Windows-style "\" as a | |||||
// delimiter; as such, they don't match the UNIX-style paths stored | |||||
// in changedLines, which come from the VCS. | |||||
$path = str_replace('\\', '/', $path); | |||||
if (!array_key_exists($path, $this->changedLines)) { | |||||
continue; | continue; | ||||
} | } | ||||
} else { | |||||
continue; | |||||
} | |||||
} | |||||
$changed = $this->getPathChangedLines($path); | $changed = $this->getPathChangedLines($path); | ||||
if ($changed === null || !$location['line']) { | if ($changed === null || !$location['line']) { | ||||
return true; | return true; | ||||
} | } | ||||
$last_line = $location['line']; | $last_line = $location['line']; | ||||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |