Skip to content

Instantly share code, notes, and snippets.

@keopx
Created September 13, 2018 08:07
Show Gist options
  • Save keopx/c58e1e55dc44032e558cc7ae35619b12 to your computer and use it in GitHub Desktop.
Save keopx/c58e1e55dc44032e558cc7ae35619b12 to your computer and use it in GitHub Desktop.
drupal: /core/phpcs.xml.dist
Reworked the script to use XML instead. This works a lot better. I do have to edit the XML file to remove some invalid characters such as EOL characters which end up in the XML file.
If you install PHP CodeSniffer and the ruleset using the instructions from #10, you can then generate the coding standards report with:
$ ./modules/coder/vendor/bin/phpcs --standard=phpcs.xml --extensions=css,inc,info,install,js,module,php,profile,test,theme --ignore=core/vendor,core/assets/vendor --report=xml core/ > report.xml
You'll need to edit the XML to remove a couple of illegal characters, then finally generate the phpcs.xml file:
$ ./phpcs-generate.php report.xml > phpcs.xml
Source: https://www.drupal.org/project/drupal/issues/2573377#comment-10372275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment