Php-cs-fixer: False positive warning about paths overridden by provided as command arguments

Created on 11 Sep 2017  ·  6Comments  ·  Source: FriendsOfPHP/PHP-CS-Fixer

In latest 2.6.0 tag for a config:

<?php

return PhpCsFixer\Config::create();

when running:

vendor/bin/php-cs-fixer fix --config=config-from-above.php src

I'm getting "Paths from configuration file have been overridden by paths provided as command arguments" warning.

kinbug

Most helpful comment

@julienfalque
default finder has some filtering, but is not assuming the place to search in.

if you use default finder without manually configuring the path in config and not providing the path for it as CLI arg, then we got error:

You must call one of in() or append() methods before iterating over a Finder.

if one has not configured path in config file and then configure it on CLI level, he shall not see the warning indeed.

@kubawerlos , are you willing to send a fix for it ? (for 2.2 line)

All 6 comments

This looks expected: the default finder will iterate all .php/.phpt files in the current directory, excluding vendor, dot files and VCS files. So when you provide src as path argument, you do override this finder.

Seems misleading at least. I'd expect the warning when I define custom finder in configuration and override on command line.

@kubawerlos
just to be extra sure, could you show your config file please?

@keradus spotted this with updating this, but also happened with the one-liner from first post.

@julienfalque
default finder has some filtering, but is not assuming the place to search in.

if you use default finder without manually configuring the path in config and not providing the path for it as CLI arg, then we got error:

You must call one of in() or append() methods before iterating over a Finder.

if one has not configured path in config file and then configure it on CLI level, he shall not see the warning indeed.

@kubawerlos , are you willing to send a fix for it ? (for 2.2 line)

@keradus yes, I will

Was this page helpful?
0 / 5 - 0 ratings