Lint Command
Lint a component using its configured extension’s linting infrastructure.
Synopsis
bash
homeboy lint <component> [options]Description
The lint command runs code style validation for a component using the linting tools provided by its configured extension. For WordPress components, this uses PHPCS (PHP CodeSniffer) with WordPress coding standards.
Arguments
<component>: Name of the component to lint
Options
--fix: Auto-fix formatting issues before validating (uses PHPCBF for WordPress)--file <path>: Lint only a single file (path relative to component root)--glob <pattern>: Lint only files matching glob pattern (e.g., "inc/**/*.php")--changed-only: Lint only files modified in the working tree (staged, unstaged, untracked)--errors-only: Show only errors, suppress warnings--summary: Show compact summary instead of full output--setting <key=value>: Override extension settings (can be used multiple times)
Examples
bash
# Lint a WordPress component
homeboy lint extrachill-api
# Auto-fix formatting issues then validate
homeboy lint extrachill-api --fix
# Lint only modified files in the working tree
homeboy lint extrachill-api --changed-only
# Lint only a single file
homeboy lint extrachill-api --file inc/core/api.php
# Lint files matching a glob pattern
homeboy lint extrachill-api --glob "inc/**/*.php"
# Lint with custom settings
homeboy lint extrachill-api --setting some_option=valueExtension Requirements
For a component to be lintable, it must have:
- A extension configured (e.g.,
wordpress) - The extension must provide a lint-runner script (at scripts/lint-runner.sh within the extension)
Environment Variables
The following environment variables are set for lint runners:
HOMEBOY_MODULE_PATH: Absolute path to extension directoryHOMEBOY_COMPONENT_PATH: Absolute path to component directoryHOMEBOY_PLUGIN_PATH: Same as component pathHOMEBOY_AUTO_FIX: Set to1when--fixflag is usedHOMEBOY_SUMMARY_MODE: Set to1when--summaryflag is usedHOMEBOY_LINT_FILE: Single file path when--fileis usedHOMEBOY_LINT_GLOB: Glob pattern when--globor--changed-onlyis usedHOMEBOY_ERRORS_ONLY: Set to1when--errors-onlyflag is usedHOMEBOY_SETTINGS_JSON: Merged settings as JSON string
Output
Returns JSON with lint results:
json
{
"status": "passed|failed",
"component": "component-name",
"output": "lint output...",
"exit_code": 0,
"hints": ["Run 'homeboy lint <component> --fix' to auto-fix..."]
}The hints field appears when linting fails without --fix, suggesting the auto-fix option.
Exit Codes
0: Linting passed1: Linting failed (style violations found)2: Infrastructure error (component not found, missing extension, etc.)