-
Notifications
You must be signed in to change notification settings - Fork 506
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
Excluded path: include example for optional path #3883
Conversation
src/Command/CommandHelper.php
Outdated
@@ -380,7 +380,8 @@ public static function begin( | |||
} | |||
|
|||
$errorOutput->writeLineFormatted('If the excluded path can sometimes exist, append <fg=cyan>(?)</>'); | |||
$errorOutput->writeLineFormatted('to its config entry to mark it as optional.'); | |||
$errorOutput->writeLineFormatted('to its config entry to mark it as optional. Example:'); | |||
$errorOutput->writeLineFormatted(' <fg=cyan>- path/something (?)</>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to show the full example including excludePaths:
and to use the actual path in question, not just path/something
. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to achieve that as my first contribution to PHPStan :)
I proposed a first change to be able to track which paths should be suggested.
from my understanding: paths adhering to FileExcluder::isFnmatchPattern()
are not evaluated, thus I opted to not suggest those as Optional. Let me know if those should be added too as suggestions.
8137302
to
dad73e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I just noticed there's a typo: |
The example should use relative paths. |
It should but right now it's impossible to get the correct relative path. Because relative path depends on the location of the config file, but at this point we have the whole parameters array decoded from all the config files at once. I don't need OP to tackle this. I can look at it myself once the PR works. |
Some brain dump while trying to implement the feature:
|
Please mark it as ready for review if it's done from your side. |
This pull request has been marked as ready for review. |
Make more clear how to mark an excluded path optional, with the use of `(?)` suffix
…t configuration
I've pushed two commits, feel free to inspect them 😊 |
Thank you! |
Make more clear how to mark an excluded path optional, with the use of
(?)
suffix