Skip to content

Enhancement: Add CLI options to check specific files and directories #1108

@mahmoudsaeed

Description

@mahmoudsaeed

Currently, the wp plugin check command supports excluding files and directories via --exclude-files and --exclude-directories, but there's no way to check only specific files or directories. This feature would add --include-files and --include-directories options that restrict checks to only the specified files and/or directories, working as the inverse of the exclude options.

Examples:

wp plugin check my-plugin --include-files=src/Plugin.php,src/admin/Settings.php
wp plugin check my-plugin --include-directories=src/admin,src/database
wp plugin check my-plugin --include-files=src/Plugin.php --include-directories=src/admin

If both include and exclude options are provided for the same type (e.g. --include-files and --exclude-files), the command could error as they are mutually exclusive. The --include-files and --include-directories options can be used together. Directory inclusion should work recursively, including all files within the specified directories and their subdirectories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions