phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

docs for git_blacklist keywords seem to contradict example #833

Closed joachim-n closed 3 years ago

joachim-n commented 3 years ago
Q A
Version GrumPHP 0.11.6
Bug? yes
New feature? no
Question? no
Documentation? yes
Related tickets --

The docs at https://github.com/phpro/grumphp/blob/master/doc/tasks/git_blacklist.md say:

Use this parameter to specify your blacklisted keywords list. Please note that reserved regex characters require proper escaping i.e. "_GET\[" in the yaml.

Meanwhile, the example in the same file says:

            - "var_dump("

Surely a '(' is a reserved regex character and should be escaped?

veewee commented 3 years ago

Yes, it should be escaped indeed. But there is a bit more to it. See discussion in https://github.com/phpro/grumphp/issues/700

The git command behaves in a strange way depending on version and amount of searched reviewed with reserved keywords etc.

Feel free to improve the documentation where possible

Thanks for reporting!

joachim-n commented 3 years ago

I'm not sure I follow what's going on in #700... I've made a quick PR for the fix I had in mind.

veewee commented 3 years ago

That is ok. Thanks