Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/251-add-plugin-editor-link
Browse files Browse the repository at this point in the history
  • Loading branch information
mukeshpanchal27 authored Oct 31, 2023
2 parents 0ef2476 + cc65fc1 commit e9b5927
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct( Plugin_Context $plugin_context ) {
* : The plugin to check. Plugin name.
*
* [--checks=<checks>]
* : Only runs checks provided as an argument in comma-separated values, e.g. enqueued-scripts, escaping. Otherwise runs all checks.
* : Only runs checks provided as an argument in comma-separated values, e.g. i18n_usage, late_escaping. Otherwise runs all checks.
*
* [--format=<format>]
* : Format to display the results. Options are table, csv, and json. The default will be a table.
Expand All @@ -87,10 +87,14 @@ public function __construct( Plugin_Context $plugin_context ) {
* [--include-experimental]
* : Include experimental checks.
*
* [--exclude-directories=<directories>]
* : Additional directories to exclude from checks
* By default, `.git`, `vendor` and `node_modules` directories are excluded.
*
* ## EXAMPLES
*
* wp plugin check akismet
* wp plugin check akismet --checks=escaping
* wp plugin check akismet --checks=late_escaping
* wp plugin check akismet --format=json
*
* @subcommand check
Expand Down Expand Up @@ -128,6 +132,15 @@ public function check( $args, $assoc_args ) {
// Create the categories array from CLI arguments.
$categories = isset( $options['categories'] ) ? wp_parse_list( $options['categories'] ) : array();

$excluded_directories = isset( $options['exclude-directories'] ) ? wp_parse_list( $options['exclude-directories'] ) : array();

add_filter(
'wp_plugin_check_ignore_directories',
static function ( $dirs ) use ( $excluded_directories ) {
return array_unique( array_merge( $dirs, $excluded_directories ) );
}
);

// Get the CLI Runner.
$runner = Plugin_Request_Utility::get_runner();

Expand Down

0 comments on commit e9b5927

Please sign in to comment.