Changeset View
Changeset View
Standalone View
Standalone View
arcanist/linter/CppVoidParameterLinter.php
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | private function isFalsePositive($line) { | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
public function lintPath($path) { | public function lintPath($path) { | ||||
$absPath = Filesystem::resolvePath($path, $this->getProjectRoot()); | $absPath = Filesystem::resolvePath($path, $this->getProjectRoot()); | ||||
$fileContent = Filesystem::readFile($absPath); | $fileContent = Filesystem::readFile($absPath); | ||||
if (preg_match_all('/\S+\s?\(void\)/', $fileContent, $voidParameters, | if (preg_match_all('/[^\s{]+\s?\(void\)/', $fileContent, $voidParameters, | ||||
PREG_OFFSET_CAPTURE)) { | PREG_OFFSET_CAPTURE)) { | ||||
foreach ($voidParameters[0] as $voidParameter) { | foreach ($voidParameters[0] as $voidParameter) { | ||||
list($function, $offset) = $voidParameter; | list($function, $offset) = $voidParameter; | ||||
if ($this->isFalsePositive($function)) { | if ($this->isFalsePositive($function)) { | ||||
continue; | continue; | ||||
} | } | ||||
Show All 11 Lines |