Hi. We hit this over at Dropbox and I believe there's a small bug in the code. Essentially our script outputs:
advice:0 You're editing this file, remember to also edit this other file.
Our regex is "/^(?P<severity>advice):(?P<line>\\d+) (?P<message>.*)$/m"
However when this code runs:
private function getMatchLineAndChar(array $match, $path) { if (!empty($match['offset'])) { list($line, $char) = $this->getEngine()->getLineAndCharFromOffset( idx($match, 'file', $path), $match['offset']); return array($line + 1, $char + 1); } $line = idx($match, 'line'); if ($line) { $line = (int)$line; } else { $line = 1; <------------------------------ }
Instead of the line being 0 (meaning whole file) the line becomes 1 which means that you'll only see the lint if you happened to edit the first line.
There's a simple work around which is to change the regex to "/^(?P<severity>advice):(?P<line>.+) (?P<message>.*)$/m" This way it uses a '0' instead of a 0.