Closed sandipansaha closed 1 year ago
Not sure if I understand this question. But you can work with an ignore or whitelist pattern to conditionally check them? See https://github.com/phpro/grumphp/blob/master/doc/tasks/git_blacklist.md
I wanted to keep the blacklist keyword but want to ignore the check for a particular function of a class but not the whole file. Like I have "print_r(" or "console.log(" added as blacklisted keywords. But I want to use it in certain methods called "debug".
Can we ignore the check for that area only? Like in phpcs we can ignore a line using - "// phpcs:ignore"
No that is not possible with that task. The task is a simple string lookup and doesn't have any context of what method or class it's in. If you want that, you probably should go for phpstan or psalm.
How we can ignore the git_blacklist.keywords in some places where it is required as we can do with PHPCS or PHPMD?
My configuration
Steps to reproduce:
Result: