From 4fc7149a30e79964e40169cf12dcac8def00c05e Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Mon, 22 Jan 2024 11:41:17 +0545 Subject: [PATCH] Add docs for all three commands --- docs/CLI.md | 105 ++++++++++++++++++++++++++++++++++++++++ docs/README.md | 2 +- docs/wp-plugin-check.md | 34 ------------- 3 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 docs/CLI.md delete mode 100644 docs/wp-plugin-check.md diff --git a/docs/CLI.md b/docs/CLI.md new file mode 100644 index 000000000..a61aeeef9 --- /dev/null +++ b/docs/CLI.md @@ -0,0 +1,105 @@ +[Back to overview](./README.md) + +# wp plugin check + +Runs plugin check. + +## OPTIONS +``` + +: The plugin to check. Plugin name. + +[--checks=] +: Only runs checks provided as an argument in comma-separated values, e.g. i18n_usage, late_escaping. Otherwise runs all checks. + +[--exclude-checks=] +: Exclude checks provided as an argument in comma-separated values, e.g. i18n_usage, late_escaping. +Applies after evaluating `--checks`. + +[--format=] +: Format to display the results. Options are table, csv, and json. The default will be a table. +--- +default: table +options: + - table + - csv + - json +--- + +[--categories] +: Limit displayed results to include only specific categories Checks. + +[--fields=] +: Limit displayed results to a subset of fields provided. + +[--ignore-warnings] +: Limit displayed results to exclude warnings. + +[--ignore-errors] +: Limit displayed results to exclude errors. + +[--include-experimental] +: Include experimental checks. + +[--exclude-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=late_escaping +wp plugin check akismet --format=json +``` + +# wp plugin list-checks + +Lists the available checks for plugins. + +## OPTIONS +``` +[--fields=] +: Limit displayed results to a subset of fields provided. + +[--format=] +: Format to display the results. Options are table, csv, and json. The default will be a table. +--- +default: table +options: + - table + - csv + - json +--- + +[--categories] +: Limit displayed results to include only specific categories. + +[--include-experimental] +: Include experimental checks. +``` + +# wp plugin list-check-categories + +Lists the available check categories for plugins. + +## OPTIONS +``` +[--fields=] +: Limit displayed results to a subset of fields provided. + +[--format=] +: Format to display the results. Options are table, csv, and json. The default will be a table. +--- +default: table +options: + - table + - csv + - json +--- +``` +## EXAMPLES +``` +wp plugin list-check-categories +wp plugin list-check-categories --format=json +``` + diff --git a/docs/README.md b/docs/README.md index e38dc130f..f0ffa57b7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,4 +3,4 @@ * [Technical Overview](technical-overview.md) * [Creating a Static Check](creating-a-static-check.md) * [Creating a Runtime Check](creating-a-runtime-check.md) -* [Plugin Check CLI Command](wp-plugin-check.md) +* [CLI Commands](CLI.md) diff --git a/docs/wp-plugin-check.md b/docs/wp-plugin-check.md deleted file mode 100644 index dbf718288..000000000 --- a/docs/wp-plugin-check.md +++ /dev/null @@ -1,34 +0,0 @@ -[Back to overview](./README.md) - -# wp plugin check - -Runs plugin check. - -## Options - -| Argument | Description | -| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| **\** | The plugin to check. Plugin name. | -| **[--checks=\]** | Only runs checks provided as an argument in comma-separated values, e.g. `i18n_usage,late_escaping`. Otherwise runs all checks. | -| **[--exclude-checks=\]** | Exclude checks provided as an argument in comma-separated values, e.g. `i18n_usage,late_escaping`. Applies after evaluating `--checks`. | -| **[--format=\]** | Format to display the results. Default: `table`. Options: `table`, `csv`, `json` | -| **[--categories]** | Limit displayed results to include only specific categories Checks. | -| **[--fields=\]** | Limit displayed results to a subset of fields provided. | -| **[--ignore-warnings]** | Limit displayed results to exclude warnings. | -| **[--ignore-errors]** | Limit displayed results to exclude errors. | -| **[--include-experimental]** | Include experimental checks. | -| **[--exclude-directories=\]** | Additional directories to exclude from checks. By default, `.git`, `vendor` and `node_modules` directories are excluded. | - -## Examples - -`wp plugin check akismet` - -Runs plugin checks with default argument values. - -`wp plugin check akismet --checks=late_escaping` - -Runs plugin checks for `late_escaping` only. - -`wp plugin check akismet --format=json` - -Runs plugin checks and generates report in `JSON` format.