Skip to content

Commit

Permalink
Work around bug in phpcs outputting invalid JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
catrope committed Apr 23, 2016
1 parent c6b31cf commit 9a36510
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ module.exports =
if confFile then execOptions.cwd = path.dirname(confFile)
return helpers.exec(command, parameters, execOptions).then (result) =>
try
# Strip time+memory information at the end; workaround for https://github.com/squizlabs/PHP_CodeSniffer/issues/969
result = result.replace(/Time: \d+ms; Memory: \d+Mb$/, '')
result = JSON.parse(result.toString().trim())
catch error
atom.notifications.addError('Error parsing PHPCS response', {
Expand Down

0 comments on commit 9a36510

Please sign in to comment.