Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time and Memory info not printed #335

Closed
llaville opened this issue Dec 5, 2014 · 3 comments
Closed

Time and Memory info not printed #335

llaville opened this issue Dec 5, 2014 · 3 comments

Comments

@llaville
Copy link

llaville commented Dec 5, 2014

Hello Greg,

Thanks for your major version 2.0 (stable). It's a nice Christmas gift :)

BTW, I've noticed at least two minor errors that could be perharps fixed.

1 - When you check a data source, and it finished wiht at least a warning or an error, you got the Time / Memory line summary, but not where all finished well.

Platform : PHP 5.6.3
PHP_CodeSniffer version 2.0.0 (stable) by Squiz (http://www.squiz.net)

Example with error :

$ php phpcs.phar -p --standard=PSR2 /path/to/sources
............................................................ 60 / 61 (98%)
E

FILE: xxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 205 | ERROR | [x] The closing brace for the class must go on the next line
     |       |     after the body
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 10.23 secs; Memory: 11.75Mb

Example without error :

$ php phpcs.phar -p --standard=PSR2 /path/to/sources
............................................................ 60 / 61 (98%)
.

Will be better to have

$ php phpcs.phar -p --standard=PSR2 /path/to/sources
............................................................ 60 / 61 (98%)
.
Time: 10.23 secs; Memory: 11.75Mb

I'll open a new report for 2nd minor issue

Thanks in advance
Laurent

@gsherwood
Copy link
Member

I actually do this on purpose so that PHPCS is a quiet as possible when nothing is found. But it's actually a good point about the progress flag because PHPCS is always going to output something in this case, so it may as well just print the time and memory there as well.

Thanks for suggestion.

@gsherwood
Copy link
Member

PHPCS now prints time and memory output even if no errors and shown, as long as progress information is being shown.

@llaville
Copy link
Author

Thanks a lot for this fix and release 2.1.0

jrfnl added a commit to jrfnl/PHP_CodeSniffer that referenced this issue Jul 29, 2024
…SR12.Files.DeclareStatement

`PSR12.Files.DeclareStatement` - bow out when parse error detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants