Created
November 15, 2011 23:19
-
-
Save msonnabaum/1368705 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of hook_drush_command(). | |
*/ | |
function code_sniffer_drush_command() { | |
$items['code-sniff'] = array( | |
'description' => '', | |
'arguments' => array( | |
'file' => "The file to run code-sniffer on.", | |
), | |
'options' => array( | |
), | |
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, | |
); | |
return $items; | |
} | |
function drush_code_sniffer_code_sniff($file) { | |
$drupalcs_path = dirname(__FILE__) . '/drupalcs/ruleset.xml'; | |
$cmd = "phpcs --standard=%s %s"; | |
drush_shell_exec($cmd, $drupalcs_path, $file); | |
$output = drush_shell_exec_output(); | |
drush_print(implode("\n", $output)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment