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
--baseline: Save current lint findings as baseline for future comparisons--ignore-baseline: Skip baseline comparison even if baseline exists--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
homeboy refactor extrachill-api --from lint --write
# 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 running viarefactor --from lint --writeHOMEBOY_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 stringHOMEBOY_LINT_FINDINGS_FILE: Path for extension to write structured lint findings JSON
Output
Returns JSON with lint results:
json
{
"status": "passed|failed",
"component": "component-name",
"output": "lint output...",
"exit_code": 0,
"hints": ["Auto-fix: homeboy refactor <component> --from lint --write"]
}The hints field appears when linting fails, suggesting the refactor command for auto-fixing.
When extensions write HOMEBOY_LINT_FINDINGS_FILE, Homeboy exposes lint_findings in JSON output and
supports baseline ratchet checks (--baseline, --ignore-baseline).
Exit Codes
0: Linting passed1: Linting failed (style violations found)2: Infrastructure error (component not found, missing extension, etc.)