Skip to content

Instantly share code, notes, and snippets.

@greggles
Created May 1, 2015 21:25
Show Gist options
  • Save greggles/dc14aba7222c2cece348 to your computer and use it in GitHub Desktop.
Save greggles/dc14aba7222c2cece348 to your computer and use it in GitHub Desktop.
Find code style errors in modules in the subdirectory
find . -type d -d 1 -exec phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,js,css,info,txt' --report-file={}_new.txt {} \;
# typical output:
# mani:contrib-patched greggles$ ls -lS *.txt
# -rw-r--r-- 1 greggles staff 10970 May 1 15:21 password_policy_style_issues.txt
# -rw-r--r-- 1 greggles staff 4887 May 1 15:21 code_coverage_style_issues.txt
# -rw-r--r-- 1 greggles staff 2681 May 1 15:21 quantcast_style_issues.txt
# mani:contrib-patched greggles$
@greggles
Copy link
Author

greggles commented May 1, 2015

This assumes you've installed the coder module https://www.drupal.org/project/coder

Of course the linter (phpcs ...) could be swapped if you use JavaScript or whatevs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment