-
Notifications
You must be signed in to change notification settings - Fork 31
Specifying the progress option in phpcs.xml breaks linter #95
Comments
When the progress option is specified, the progress meter is printed regardless of the report format specified. A possible fix would be to skip lines output by |
I'm going to mark this as closed only because this really should be handled in If you file an issue over there a link back here would be nice to follow the issue! |
Maybe related: It should ignore <!-- ... -->
<file>./src</file>
<!-- ... --> |
Looks like it's definitely related... we are asking it to lint text from |
By the way, using <!--<arg value="p"/>-->
<arg value="sp"/> If not, the same error is throws. I tried and I thought I had found a work-around for this, but it was just an illusion. 😞 |
@Arcanemagus, use '-q' switch when running the phpcs. It disables progress, while still outputting the report in json format:
This option is available since PHPCS 2.6.2 |
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.
When a standard specifies `<arg value="p"/>` (progress) option linter breaks since it expects json output, and PHPCS spits out dots for passing files and 'E' for errors. Adding `-q` option suppresses progres output. Maybe related: ikappas#32 See the same issue in PHPCS linter for atom: AtomLinter/linter-phpcs#95
Can you think of any reason why Normally in my phpcs.xml.dist I have
Only way PHPCS will run without throwing the output error is to comment that out. No big deal, but from my understanding the updates above should squash that. |
@jaredatch Does it work properly when you run it manually on the CLI? |
Correct, CLI has no issues. Running When in atom, its acting like |
Your screenshot shows that both Apparently
You might actually be running two different versions of PHPCS. |
@Arcanemagus as for overriding those settings for older (pre-3.x) versions, here's what I tried (so you don't have to repeat it yourself):
So, what else could be done?
|
In my settings I have the executable path explicitly defined and the The screenshot does indeed show the json and full+summary+source being output, the later of course is what breaks things. If I run So what is weird is that if I specify the report via CLI it does indeed override the other items defined in the config, but that's not what is happening when it gets triggered inside Atom. |
@jaredatch can you click that |
@jaredatch I'm betting that the difference is due to you passing the filename in directly, while we pas the file contents in via stdin. If you run @weirdan Thanks for the investigation in #95 (comment). This is quite the mess... Option 2 definitely sounds fragile to me, I'd rather avoid that route if possible. Options 1 seems like it is viable, if extremely annoying to implement. Option 4 could work, but I worry about:
The full output received should be in the console, nobody ever seems to check there though 😛. |
Received, yes, it's there, but I was talking about the 'command line' executed (executable + parameters + exec options actually). That could be useful to reproduce things in CLI, to debug version-dependent arguments passing, etc.
Only if PHPCS uses There's ~/.atom folder on my machine, which contains atom-specific things (the path could be obtained from
Then people would complain about
Isn't this extension long past the point where it was true? I've just checked -
— far from what I would run:
|
I'm pretty sure config files can reference custom rules with relative paths, meaning the config will likely have to be in the same directory as the current config.
Ha, when I wrote that I was just assuming that like most other options that was broken at some point in PHPCS's past, looks like we handle that the same for all versions so we are probably okay here.
Maybe, but it's certainly possible to run it like that. Note that That just leaves So although you may not type all that out manually, the only major differences there are |
Adding
<arg value="p" />
to thephpcs.xml
file causes the following error message to display:The text was updated successfully, but these errors were encountered: