-
Notifications
You must be signed in to change notification settings - Fork 436
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
Add whitelist_patterns option to Phpcs task #160
Conversation
|
||
/** @var string|null $whitelistPathPattern */ | ||
$whitelistPathPattern = $this->getWhitelistPathPattern($config); | ||
if (!$whitelistPathPattern) { |
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.
Shouldn't both the whitelist as the extensions filter be applied?
This can be done in 2 methods instead of adding the extensions with the getWhitelistPathPattern method.
Thanks for the PR. Could you add some tests for this feature? |
Hi @veewee, Is the option name Thank you for your feedback. |
It looks good. Alternatives are |
I change parameter name to |
It looks pretty good but I would still like to get rid of the |
Hi @veewee sorry for the late answer, I will take a look this week at your return. |
@mgeoffray Are you planning to finish this PR any time soon? Thanks! |
@veewee Yes sorry too much work beside, I prioritized it to correct your return quickly ;) |
No problem! Thanks :) |
Is anyone taking care of this ? |
@jeremy-bruns, @mgeoffray is taking care of this. Currently he is busy so this new feature is on a hold. Feel free to contact him, maybe you can take care of this for him. |
@jeremy-bruns Hi, yes I plan to watch it from the beginning of next week on Monday or Tuesday maximum. I will keep you in touch! |
I worked on it this week I think I can deliver the fix this weekend ;) |
Hi @veewee, |
Hi @veewee, |
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.
Thanks for your work. I've added some litlte remarks.
* | ||
* @return FilesCollection | ||
*/ | ||
public function paths(array $patterns) |
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.
This code is almost the same as the regular path()
method. Can you let the path()
method use the paths()
method instead of duplicating the code?
There should also be a spec test for this new feature.
Note that we are moving away from the old array()
syntax and are using the new short array syntax instead. Can you replace that one?
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.
@veewee Yes you are right I refactor the path() function to call paths()
I forgot this one array, I have changed it.
What do you mean spec test, a new function testing it or just add the new line in \spec\GrumPHP\Task\PhpcsSpec::it_should_have_configurable_options
?
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.
Indeed, the configurable options spec from the task should also contain the new option. The last commit is good.
I was talking about the GrumPHP/Collection/FilesCollectionSpec that should contain a new test for the new paths method. Can you add this one?
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.
Hi @veewee,
I have just added the function for paths() Spec test
It looks good, thanks! |
@veewee OK great ! Thanks :) |
This PR add a new
whitelist_patterns
option toPhpcs
task. It will be used to filter files to be validated.Example for a Symfony, validate PHP files only in
src/
directory