Download the PHP package yeremi/cli-standards without Composer
On this page you can find all versions of the php package yeremi/cli-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yeremi/cli-standards
More information about yeremi/cli-standards
Files in yeremi/cli-standards
Package cli-standards
Short Description PHPCS standards for CLI command design, currently focused on WP-CLI code, with blocking and advisory sniffs for safety, automation, output, and documentation.
License MIT
Homepage https://github.com/yeremi/cli-standards
Informations about the package cli-standards
CLIStandards PHPCS Standard
PHPCS sniffs for CLI command design quality, currently focused on WP-CLI command code.
This package publishes the CLIStandards coding standard as a Packagist-ready Composer package. It enforces 18 checks derived from the CLI Standards model:
- 8 blocking checks reported as errors
- 10 advisory checks reported as warnings
Installation
The Composer installer plugin registers the standards automatically. After installation:
You should see CLIStandards and CLIStandardsMust in the installed standards list.
Usage
Run the standard against your CLI command code:
Useful variants:
CLIStandardsMust is intended to behave like CLIStandards with warnings suppressed, which makes it useful for staged CI adoption.
Example Output
Anonymized example from a real local scan:
What It Enforces
Error-level sniffs:
CommandRegistrationFlagNamingOutputMethodErrorSeverityConfirmOnDeleteConfirmPassthroughDocblockOptionsDocblockExamples
Warning-level sniffs:
FlagExtractionStdoutStderrFormatSupportAvailableFieldsWpErrorHandlingDryRunSupportBatchProcessingProgressBarBatchSizeFlagSinceAnnotation
The implementation is intentionally heuristic in some areas. It favors practical signal over deep semantic analysis, so some checks can still produce false negatives or advisory-only warnings.
Scope
The standard name is generic, but the current implementation is not framework-agnostic. The sniffs are tuned for codebases that expose commands through WP_CLI, and most checks activate only when WP_CLI usage is detected.
Add To phpcs.xml.dist
Development
Install dependencies:
Run the fixture-based regression suite:
For contribution workflow and expectations, see CONTRIBUTING.md.
Repository Layout
CLIStandards/: the main standard and sniff classesCLIStandardsMust/: blocking-only variant for staged adoptiontests/Fixtures/: regression fixtures for expected violations and clean casesscripts/verify-fixtures.php: assertion-based test runner used by CI
License
See LICENSE (MIT).
All versions of cli-standards with dependencies
dealerdirect/phpcodesniffer-composer-installer Version ^1.0
squizlabs/php_codesniffer Version ^3.7