rtCamp/action-phpcs-code-review

Improve recognition of custom rulesets

jrfnl opened this issue ยท 4 comments

jrfnl commented

PHPCS custom rulesets can have any of the below names. Based on the readme and a summary code review, this action only recognizes one of them. All four, however, should be recognized.

  • .phpcs.xml
  • phpcs.xml (already recognized)
  • .phpcs.xml.dist
  • phpcs.xml.dist

If multiple files exists, how should the order be determined?

We can use this order as mentioned on docs: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file

Note: If multiple default configuration files are found, PHP_CodeSniffer will select one using the following order: .phpcs.xml, phpcs.xml, .phpcs.xml.dist, phpcs.xml.dist

jrfnl commented

What @PatelUtkarsh said, i.e. the order in which I listed them ;-)

I didn't double check your order, my bad. @jrfnl