Arun
Arun

Reputation: 3721

Netbeans php-cs-fixer end up with error "Files that were not fixed due to errors reported during linting after fixing:"

I am using php-cs-fixer for code formatting in Netbeans 8.2. When I try to format one file, it shows the error

Files that were not fixed due to errors reported during linting after fixing:

I searched for the fix in many websites, but couldn't get this fixed. Is there any way to fix this? I tried with both php-cs-fixer 1 and php-cs-fixer 2.

Upvotes: 0

Views: 2221

Answers (2)

呂學洲
呂學洲

Reputation: 1413

There is also an option to see what happen in progress.

$ ./vendor/bin/php-cs-fixer fix src/ErrorFile.php -vvv 

The --verbose option will show the applied rules. When using the txt format it will also display progress notifications.

NOTE: if there is an error like "errors reported during linting after fixing", you can use this to be even more verbose for debugging purpose

  • -v: verbose
  • -vv: very verbose
  • -vvv: debug

Upvotes: 1

keradus
keradus

Reputation: 534

The error message means that PHP CS Fixer loaded some files from drive, apply changes on them, and then realised that files are not valid anymore (invalid PHP syntax) after those changes, thus it decided to not save it. That's one of the safety mechanism of PHP CS Fixer to not break your project.

This means that you have found an issue in PHP CS Fixer itself. Please, verify you are using newest release, maybe the bug was already fixed!

If not, please consider to expose your configuration file (if any) and content of files you got listed at https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/new !

Upvotes: 1

Related Questions