Repository navigation
feat: add structured check JSON presentation - #94
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Render check results src/Console/CheckResultRenderer.php, tests/Console/CheckResultRendererTest.php |
The renderer emits compact or pretty JSON. If encoding fails, it creates an operational-error result while retaining selection and status fields. Tests check formatting, diagnostics, and encoding-failure output. |
Integrate JSON formats src/Console/Command/CheckCommand.php, src/Console/StructuredCheckOperation.php, tests/Integration/StandardsTest.php, docs/process-contracts.rst, .changelog/check-json-pretty.md |
The command routes both JSON formats through the structured operation and passes the pretty-format flag. Integration tests check matching results, ANSI-free output, and unchanged source files. Documentation and the changelog describe the formats and result contract. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant CheckCommand
participant StructuredCheckOperation
participant StructuredCheckRunner
participant CheckResultRenderer
participant SymfonyStyle
CheckCommand->>StructuredCheckOperation: Select JSON format and pass pretty flag
StructuredCheckOperation->>StructuredCheckRunner: Run checks
StructuredCheckRunner-->>StructuredCheckOperation: Return check result
StructuredCheckOperation->>CheckResultRenderer: Render result with pretty flag
CheckResultRenderer->>SymfonyStyle: Write JSON and diagnostics
CheckResultRenderer-->>CheckCommand: Return result exit code
Possibly related issues
- Issue 10: This PR adds
check --format=json-prettyand a dedicated check result renderer, which address part of the issue’s objectives. The issue remains open for other result and Rector work.
Merge Risk: 
Minimal · up to 660d7
-
Pretty JSON uses the existing check result path. No material merge-blocking issue was found.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 5 files. (2 skipped: 2 unsupported.)
Full details: Description check
-
Explanation
The pull request description directly matches the changeset. It explains the extracted CheckResultRenderer, the new check --format=json-pretty option, preserved JSON schemas and exits, documentation updates, tests, and validation status.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit taps out JSON neat,
With curly braces lined just right.
Compact or pretty, checks report,
No bright escape codes in the light.
Then hops away on silent feet.
Comment @coderabbitai help to get the list of available commands.
|
@codex review Please review current HEAD |
|
@coderabbitai full review Please review exact current HEAD |
✅ Action performed
|
Changelog✅ Contribution check passed. Head: Base: Contribution: 1 new valid fragment(s). Policy: ordinary.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex security review Review exact HEAD |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Please review updated exact HEAD |
|
@coderabbitai full review One request for new HEAD |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 780e60eaba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Please review current HEAD |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Please review new exact HEAD |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review Please review current exact HEAD |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
check --format=jsonalready exposes the versioned ECS check result, but its presentation is embedded in orchestration and cannot emit indented JSON. ExtractCheckResultRendererand addcheck --format=json-prettythrough the existing read-only execution path.Centralize public
text,jsonandjson-prettypresentation identifiers in the backedOutputFormatenum. Check accepts all three; Rector keeps only text and native JSON preview. Inventory formats, ECS worker protocols and JSON schema fields retain their existing meanings. Use named arguments for every suppliedCheckResultfield and the touched mixed/opaque calls, with parameter names checked against actual signatures. CLI strings, native schemas, exits and execution authority are preserved. Native OptionsuggestedValuesuses documented method-reference callbacks with concise descriptions.OutputFormat::values()derives identifiers directly from cases(); the rejected VALUES constant is removed. Rector shares a single supported-format policy between completion and execution. String binding plus explicit validation preserves invalid-format diagnostics and empty stdout; suggestions do not validate input. New native completion/container tests cover both option styles, command-specific subsets, defaults and invalid paths without subprocess execution. Docs remain in the canonical process/result guide, plus the required minor fragment.This is a focused increment for #10; the issue remains open for remaining Rector/result work. The separate Rector validator extraction uses its own branch/PR from main and does not depend on this PR. No Composer, distribution, headers or workflow changes.
Current HEAD:
55e630f0e4371f31e9a5e9bb78030787e322597c; base:159cdcca916e18c3d76853d093a20e3607856526.Earlier validation on
660d721: affected local unit tests 14/120 assertions, native JSON integration 1/19 assertions, installed help and changed-file syntax/style pass; hosted PHP 8.3–8.5, reusable checks, Changelog and CodeQL pass (PHP 8.5 full suite: 301 tests / 2,592 assertions). Current HEAD must establish its own evidence.Symfony Console is locked to 7.4.21. Its Option implementation supports suggestedValues and native backed-enum conversion. Native conversion raises a binding diagnostic before invocation; this PR preserves existing string API and explicit rejection behavior instead of changing that error contract. No cases() invocation occurs inside an attribute; the attribute contains a method reference, called by native completion at runtime. The actual fast-forward/enum main at 55d6e83679cfd8b2481e6151870c7ed71f6985da has HasValues, delegating to EnumHelper::values(), and no predefined output-format enum. That package is not installed here; a local cases-derived projection avoids a new dependency and Composer/distribution scope. No trait/file is copied.
Rector research found
AddNameToBooleanArgumentRectorandAddNameToNullArgumentRector, which name arguments from the first matched value onward and do not enforce naming all preceding values/opaque integers.SortCallLikeNamedArgsRectoronly sorts existing names. No global or consumer rule is enabled; changes are manually scoped to reviewed signatures. Sources: native name-adder, sorting rule, PHP-CS-Fixer rule catalog.Awaiting human approval; no merge, PR approval or release is performed by this task. GitHub changed draft=false externally before this update; this task did not mark the PR ready.