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

PHPCBF no-patch option shows an error when there are no fixable violations in a file #401

Closed
aik099 opened this issue Dec 28, 2014 · 4 comments

Comments

@aik099
Copy link
Contributor

aik099 commented Dec 28, 2014

Here is the fragment of phpcbf output:

Processing upgrades.php [PHP => 642 tokens in 70 lines]... DONE in 38ms (1 fixable violations)
        => Fixing file: 0/1 violations remaining [made 2 passes]... DONE in 96ms
    => File was overwritten
Processing constants.php [PHP => 1292 tokens in 228 lines]... DONE in 83ms (0 fixable violations)
    => Fixing file: 0/0 violations remainingERROR in 0ms

I guess when 0 fixing passes were made, then [made 0 passes]... isn't printed and ERROR word has no space before it and remaining word.

@gsherwood
Copy link
Member

When I run phpcbf over a file with 0 fixable violations, the output I get is:

Processing temp.php [PHP => 6 tokens in 2 lines]... DONE in 1ms (0 fixable violations)
No fixable errors were found

How are you running phpcbf to make it generate that error?

@aik099
Copy link
Contributor Author

aik099 commented Jan 5, 2015

I'm using this command:

phpcbf --standard=/path/to/project/vendor/aik099/coding-standard/CodingStandard -wps --no-patch --encoding=UTF-8 --extensions=php -d memory_limit=-1 ../../modules/custom/constants.php

The constants.php file is:

<?php
// product types.
define('PRODUCT_TYPE_RETAIL', 1);
define('PRODUCT_TYPE_MANUFACTURED', 10);

The output is the same:

Changing into directory /path/to/project/modules/custom
Processing constants.php [PHP => 20 tokens in 4 lines]... DONE in 3ms (0 fixable violations)
    => Fixing file: 0/0 violations remainingERROR in 0ms
Fixed 0 files
Time: 54ms; Memory: 4.75Mb

@gsherwood
Copy link
Member

Thanks for providing that. It's the --no-patch option that is printing the output incorrectly.

@gsherwood gsherwood changed the title Missing space in "phpcbf" output PHPCBF no-patch option shows an error when there are no fixable violations on a file Jan 6, 2015
@gsherwood gsherwood changed the title PHPCBF no-patch option shows an error when there are no fixable violations on a file PHPCBF no-patch option shows an error when there are no fixable violations in a file Jan 6, 2015
gsherwood added a commit that referenced this issue Jan 6, 2015
@aik099
Copy link
Contributor Author

aik099 commented Jan 6, 2015

Thanks.

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