WordPress / WordPress/plugin-check

Enhancement: Add CLI options to check specific files and directories

Open
#1,108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
362
Forks
126
Avg merge
1d 23h
Merged PRs (30d)
22

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the wp plugin check command and trace how the existing --exclude-files and --exclude-directories options select paths. Implement matching include options with recursive directory behavior, define handling for conflicting include and exclude options, and verify that the example commands restrict checks to the requested paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.