From 1c3c46ef74a177d005f3dcacda3f89997ad1faee Mon Sep 17 00:00:00 2001 From: Kamran Abdul Aziz Date: Fri, 29 May 2026 22:30:53 +0530 Subject: [PATCH] Clarify ignore-codes CLI documentation --- docs/CLI.md | 12 +++++++++++- includes/CLI/Plugin_Check_Command.php | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/CLI.md b/docs/CLI.md index 9b7eab8aa..20e79a444 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -17,7 +17,11 @@ Runs plugin check. Applies after evaluating `--checks`. [--ignore-codes=] -: Ignore error codes provided as an argument in comma-separated values. +: Ignore result codes provided as an argument in comma-separated values, e.g. missing_composer_json_file. +Result codes are individual findings emitted by checks. They are different from check slugs used with +`--checks` and `--exclude-checks`. +Use an output format such as `--format=json` or `--format=csv` to inspect result codes. +For example: `wp plugin check akismet --format=csv --fields=code,message`. [--format=] : Format to display the results. Options are table, csv, json, ctrf, strict-table, strict-csv, strict-json, and strict-ctrf. The default will be a table. @@ -52,9 +56,13 @@ options: [--exclude-directories=] : Additional directories to exclude from checks. By default, `.git`, `vendor`, `vendor_prefixed`, `vendor-prefixed` and `node_modules` directories are excluded. +This only excludes files from file-based scans. It does not suppress plugin-level findings such as +missing_composer_json_file; use `--ignore-codes` for specific result codes. [--exclude-files=] : Additional files to exclude from checks. +This only excludes files from file-based scans. It does not suppress plugin-level findings such as +missing_composer_json_file; use `--ignore-codes` for specific result codes. [--severity=] : Severity level. @@ -87,6 +95,8 @@ options: ``` wp plugin check akismet wp plugin check akismet --checks=late_escaping +wp plugin check akismet --format=csv --fields=code,message +wp plugin check akismet --ignore-codes=missing_composer_json_file wp plugin check akismet --format=json wp plugin check akismet --format=ctrf wp plugin check akismet --mode=update diff --git a/includes/CLI/Plugin_Check_Command.php b/includes/CLI/Plugin_Check_Command.php index 860ccde18..0d676b8d6 100644 --- a/includes/CLI/Plugin_Check_Command.php +++ b/includes/CLI/Plugin_Check_Command.php @@ -77,7 +77,11 @@ public function __construct( Plugin_Context $plugin_context ) { * Applies after evaluating `--checks`. * * [--ignore-codes=] - * : Ignore error codes provided as an argument in comma-separated values. + * : Ignore result codes provided as an argument in comma-separated values, e.g. missing_composer_json_file. + * Result codes are individual findings emitted by checks. They are different from check slugs used with + * `--checks` and `--exclude-checks`. + * Use an output format such as `--format=json` or `--format=csv` to inspect result codes. + * For example: `wp plugin check akismet --format=csv --fields=code,message`. * * [--format=] * : Format to display the results. Options are table, csv, json, ctrf, strict-table, strict-csv, strict-json, and strict-ctrf. The default will be a table. @@ -112,9 +116,13 @@ public function __construct( Plugin_Context $plugin_context ) { * [--exclude-directories=] * : Additional directories to exclude from checks. * By default, `.git`, `vendor`, `vendor_prefixed`, `vendor-prefixed` and `node_modules` directories are excluded. + * This only excludes files from file-based scans. It does not suppress plugin-level findings such as + * missing_composer_json_file; use `--ignore-codes` for specific result codes. * * [--exclude-files=] * : Additional files to exclude from checks. + * This only excludes files from file-based scans. It does not suppress plugin-level findings such as + * missing_composer_json_file; use `--ignore-codes` for specific result codes. * * [--severity=] * : Severity level. @@ -153,6 +161,8 @@ public function __construct( Plugin_Context $plugin_context ) { * * wp plugin check akismet * wp plugin check akismet --checks=late_escaping + * wp plugin check akismet --format=csv --fields=code,message + * wp plugin check akismet --ignore-codes=missing_composer_json_file * wp plugin check akismet --format=json * wp plugin check akismet --mode=update * wp plugin check akismet --ai