Skip to content

Commit

Permalink
Revise the thriftcheck error pattern (#82)
Browse files Browse the repository at this point in the history
More recent versions of thriftcheck use a more compliant GCC-style
output format which includes a space before the "severity" group.
This matches similar tools, like shellcheck.

This change adjusts the handler's pattern to parse this format in a
backwards-compatible way (even though backwards compatibility isn't
critical long-term as thriftcheck itself is close to its 1.0 release).
  • Loading branch information
jparise authored Sep 8, 2021
1 parent a625686 commit b276616
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ThriftCheckLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ protected function getMandatoryFlags() {
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = phutil_split_lines($stdout, false);

// file.thrift:3:1:error: unable to find include path for "bar.thrift" (include.path)
// file.thrift:3:1: error: unable to find include path for "bar.thrift" (include.path)
$regexp =
'/^(?:.*?):(?P<line>\d+):(?P<char>\d+):(?P<severity>(error|warning)): '.
'/^(?:.*?):(?P<line>\d+):(?P<char>\d+): ?(?P<severity>(error|warning)): '.
'(?P<msg>.*) \((?P<code>.*)\)$/';

$messages = array();
Expand Down

0 comments on commit b276616

Please sign in to comment.