PHPCS exclusion list
It might be a duplicate of #1884 - but I am looking for a way to tell my PHPCS that they can ignore exactly same what it is listed on .gitignore. It will save a lot of time. Also, I would like to have a file which I can tell import .gitignore, and we can also add more in the list which is not filled on .gitignore.
What do you think?
An option in the ruleset XML format to import a list of files/directories to exclude, which would allow you to specify your .gitignore file, might work. I don't think I'd want a dedicated CLI option to do this though.
@gsherwood, the option sounds a good idea. Do you have an example about how to import a list of file/directories to exclude in the ruleset XML format?
Do you have an example about how to import a list of file/directories to exclude in the ruleset XML format?
Nothing currently exists in PHPCS to do this.
We would need something like this exactly in Drupal also. Did some digging and maybe if the excluded list of directories could be also specified in the CodeSniffer.conf file (https://github.com/squizlabs/PHP_CodeSniffer/blob/3.4.2/CodeSniffer.conf.dist) then a composer-plugin could automatically registers exclusion paths in a project from various sources, for example .gitignore(s), environment variables, etc.
https://github.com/Dealerdirect/phpcodesniffer-composer-installer plugin uses this file to auto-register available PHPCS configurations. The suggested composer plugin could also do the same with excluded paths.