1

I have a php file that I ran through phpcs. It completed successfully and reported that phpcbf could fix 1199 issues. However, when I run phpcbf, it errors out with no explanation at what looks like the end of the process. If I delete about half of the code in the file it will run successfully. I have tried with and without switch --no-patch. I have tried with -vv and -v (the former I found in a forum and latter I just tried on my own). They do not seem to do anything. I would like to know if there is any way to print out more details so I can see what it is getting stuck on? Below is a few snips of the commands I ran. Thanks

[...]
1478 | ERROR   | [x] There must be no blank line following an inline
      |         |     comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1199 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 414ms; Memory: 16.5Mb
[...]
C:\Users\name>phpcbf phpFile.php --no-patch
Changing into directory C:\Users\name
Processing CaseModel.php [PHP => 12094 tokens in 1468 lines]... DONE in 329ms (1204 fixable violations)
        => Fixing file: 1/1204 violations remaining [made 50 passes]... ERROR in 29.67 secs
Fixed 0 files
Time: 30.06 secs; Memory: 49.5Mb
C:\Users\name>phpcbf CaseModel.php
Changing into directory C:\Users\name
Processing CaseModel.php [PHP => 12094 tokens in 1468 lines]... DONE in 328ms (1204 fixable violations)
        => Fixing file: 1/1204 violations remaining [made 50 passes]... [31mERROR[0m in 30.12 secs
No fixable errors were found
Time: 30.51 secs; Memory: 49.5Mb
Nhan
  • 3,595
  • 6
  • 30
  • 38
user1404617
  • 585
  • 1
  • 5
  • 20
  • Try using phpcs with the diff report. If it is failing to fix a file, the diff report will come back blank. But you can get more info by using the verbosity settings. If you have a small snippet of code that is failing, you'll get the most information by running `phpcs /path/to/file.php --report=diff -vvv`. The last part of the output will show what it is trying to fix, and you'll probably find that it is in a loop. Also try the latest 2.7.1 version if you haven't already. – Greg Sherwood Dec 04 '16 at 02:24
  • Could you share rules you are using? What output exactly do you expect? Error or information about changes in the code? – Tomas Votruba May 03 '17 at 07:30

0 Answers0