Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Work around bug in phpcs outputting invalid JSON #144

Closed
wants to merge 1 commit into from

Conversation

catrope
Copy link

@catrope catrope commented Apr 23, 2016

See squizlabs/PHP_CodeSniffer#969

This is causing Atom to show an error every time I save a file
with no phpcs errors.

@Arcanemagus
Copy link
Member

Hmmmm, I don't really like the idea of fixing this here, but on the other hand phpcs can take a while to get a fix out...

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a # FIXME: Remove when the above issue is fixed (Or below, I don't really care which).

Just to make it explicit that this is something that should be removed as soon as we can do so.

@catrope
Copy link
Author

catrope commented Apr 26, 2016

It turns out I'm an idiot and had <arg value="p"/> in my phpcs.xml file. Removing that fixes the issue.

phpcs's behavior is still weird in that it only adds this information if no errors were found (and doesn't if errors were found), but I can't blame it too much for putting in this information if my config file asks for ut,

@catrope catrope closed this Apr 26, 2016
@Arcanemagus
Copy link
Member

Ha! Glad you found it 😆

weirdan added a commit to weirdan/linter-phpcs that referenced this pull request Dec 16, 2016
This forces phpcs to not print neither totals nor progress even if config
specifies -p (progress) option. Will work with phpcs 2.6.2 and newer.

Several people reported problems with superfluous phpcs output, see
AtomLinter#95 and AtomLinter#144.
Arcanemagus pushed a commit that referenced this pull request Dec 22, 2016
* Use '-q' when phpcs supports it

This forces phpcs to not print neither totals nor progress even if config
specifies -p (progress) option. Will work with phpcs 2.6.2 and newer.

Several people reported problems with superfluous phpcs output, see
#95 and #144.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants