Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance list-checks command #379

Merged

Conversation

ernilambar
Copy link
Member

@ernilambar ernilambar commented Jan 9, 2024

Refactor list-checks command with improvements.

  • Fix: get_checks() of Default_Check_Repository by default does not return experimental checks. This PR fix that issue for returing all checks with parameter Default_Check_Repository::TYPE_ALL | Default_Check_Repository::INCLUDE_EXPERIMENTAL.
  • Addition: --categories argument is added to filter checks by categories.
  • Addition: --stability argument is added to filter checks by stability. Takes either stable or experimental.

Output:

wp plugin list-checks --stability=stable - Currently all checks will be displayed as we dont have experimental checks yet.

stability

wp plugin list-checks --categories=performance

single-category

wp plugin list-checks --categories=performance,general

multiple-category

@ernilambar
Copy link
Member Author

tests/behat/features/plugin-list-checks.feature Outdated Show resolved Hide resolved
tests/behat/features/plugin-list-checks.feature Outdated Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernilambar I think the ideas here make sense, however the implementation can be simplified.

includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
@ernilambar
Copy link
Member Author

Updates:

  • get_checks() will return stable checks only by default. If --include-experimental is given, it will include experimental checks along with stable checks.
  • --categories - Existing Check_Categories::filter_checks_by_categories() is used for filtering checks based on categories.
  • --stability is removed and implemented --include-experimental flag.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernilambar The production code changes look great to me now. However it looks like there are some Behat test failures, see https://github.com/WordPress/plugin-check/actions/runs/7470848675/job/20330167511?pr=379.

cc @swissspidy

@swissspidy
Copy link
Member

Those Behat failures are unrelated and fixed in #381

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge #381 and then refresh this branch to make sure the failures are gone :)

Thank you for the PR!

@mukeshpanchal27 mukeshpanchal27 merged commit 571a65a into WordPress:trunk Jan 11, 2024
24 checks passed
@ernilambar ernilambar deleted the enhance-list-checks-command branch January 11, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants