Skip to content

fix: preserve consumer parameter syntax by default - #65

Merged
coisa merged 1 commit into
mainfrom
codex/consumer-language-compatibility
Oct 27, 2026
Merged

coisa merged 1 commit into
mainfrom
codex/consumer-language-compatibility

Conversation

@coisa

@coisa coisa commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Refs #2 and #5: this corrects one confirmed consumer-language regression; target selection and the wider consumer/PHP dependency matrices remain partial, so neither issue is closed.

A real error-handler consumer declares PHP ^7.4 || ^8.0. Running published Code Standards v0.3.2 on PHP8.5 suggested trailing commas in parameter declarations, which require PHP8.0. The formatter host does not authorize raising the consumer's syntax floor.

Omit only parameters from native TrailingCommaInMultilineFixer default elements. Preserve after_heredoc, arguments, arrays, destructuring and match; existing parameter commas remain untouched. The native ECS callback still runs last and can explicitly replace the configuration after a consumer reviews PHP8-or-later compatibility. No new target-version parser, CLI option, dependency or consumer mutation. This conservative exception is not global PHP7.4 certification or an unconditional PER conformance claim.

Commit b8908ae, direct base648c57aa6843d01b11f02a4cf163b1865f9e6a1b; six independently reviewed paths. No dependency/lock update or code from the blocked multiline candidate.

Validation: exact-lock native installation51packages/zero updates on PHP8.5.12/ECS13.3.9/Rector2.4.2/PHPStan2.1.51. Qualified RED reproduced the parameter-comma failure; GREEN preset+CLI3tests/158assertions. Review strengthened the override proof to require absence of array/argument commas and exact violation exit2; final focused2tests/28assertions passed. Full CI=true GITHUB_ACTIONS=true composer check passed123tests/840assertions, Composer strict/platform and own35PHP syntax/ECS check. Tests cover typed/nullable parameters, existing commas, arguments/arrays, new-expression parentheses, explicit opt-in override, check without writes, explicit fix, warm-cache and idempotence. No PHP7.4 runtime was executed. Hosted matrix and current-head external reviews remain gates.

The consumer pilot remained unchanged, including its65preexisting tracked diffs, index, untracked/ignored entries, manifest and lock. A patch fragment records this focused correction. No merge, tag or release.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bb02677e-9d39-4d18-9a5e-925bae6532e8
Commits

Reviewing files that changed from the base of the PR and between 648c57a and b8908ae.

Files selected for processing: 6
  • .changelog/conservative-parameter-commas.md
  • docs/resolved-preset.md
  • src/Config/ECSConfig.php
  • tests/Fixtures/consumer-language.php.inc
  • tests/Fixtures/preset-rules.json
  • tests/Integration/StandardsTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Formatting no longer adds trailing commas to function parameter lists based on the PHP version running the formatter. Existing commas are preserved, and other supported trailing-comma formatting remains unchanged.
  • Documentation
    • Clarified that parameter-list trailing commas require PHP 8.0 or later and that the formatter does not infer the consumer’s PHP version. Consumers can explicitly enable parameter commas in their configuration.

The default trailing-comma configuration no longer adds commas to parameter declarations. Consumers can opt in to parameter commas, and integration tests cover the default and override behavior.

Changes: Parameter comma policy

Layer / File(s) Summary
Configure the default policy
src/Config/ECSConfig.php, tests/Fixtures/preset-rules.json, docs/resolved-preset.md, .changelog/conservative-parameter-commas.md
The default excludes parameter declarations from the trailing-comma elements while retaining the other configured elements. Documentation describes the PHP 8.0 syntax requirement, existing comma preservation, and explicit consumer configuration.
Verify default and override behavior
tests/Fixtures/consumer-language.php.inc, tests/Integration/StandardsTest.php
Integration tests check default formatting and an explicit parameter-comma override. They also verify repeated check/fix runs leave the formatted result unchanged.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 1: This change addresses part of the consumer PHP compatibility policy by excluding parameter commas from the default.
  • Issue 5: The integration tests add resolved-rule behavior and idempotence coverage, but do not provide a full rule-by-rule policy comparison.
  • Issue 35: The change documents a parameter-list policy difference, but does not adopt PER3.

Possibly related PRs

Merge Risk: Minimal · up to b8908

The default avoids introducing parameter commas while leaving explicit opt-in available. No actionable merge-blocking risk is identified from the supplied evidence.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving consumer parameter syntax by default.
Description check Passed The description is directly related to the changeset and explains the compatibility issue, configuration change, override behavior, testing, and scope.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files. (4 skipped: 4 unsupported.)

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.

❤️ Share

A rabbit checks each comma’s place
No host-born mark can change its face
The default leaves parameters bare
An opt-in adds commas with care
Check and fix return the same
The rabbit hops, content with the game

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Changelog

✅ Contribution check passed.

Head: b8908aea8fc880e3e300ddc893bd31774965fa9d

Base: 648c57aa6843d01b11f02a4cf163b1865f9e6a1b

Contribution: 1 new valid fragment(s). Policy: ordinary.

  • conservative-parameter-commas.md — fixed, patch

    Avoid introducing PHP 8.0 parameter-list commas from the formatter's host runtime by default; preserve native consumer overrides and existing commas.

coisa commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact draft HEAD b8908ae. This bounded compatibility correction removes only native parameter trailing commas from the default, preserving callback-last overrides and existing syntax. Independent final source review and full local composer check passed123tests/840assertions; hosted PHP8.3/8.4/8.5, reusable check, Changelog and CodeQL are successful. No existing Codex request or running marker is present for this HEAD. The PR remains draft pending real external gates; this does not request a merge, tag or release.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T06:19:27.657289Z b8908ae Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T06:20:46.272388Z b8908ae Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: b8908aea8f

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b8908aea8f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

coisa commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact draft HEAD b8908ae. This is the first CodeRabbit request on this PR; the automatic draft skip is not approval and no review is active here. The prior repository quota response at05:20 estimated another included review after46minutes; it is now after06:10UTC. This request uses only included capacity and does not authorize credits or configuration changes.

The six-path correction omits only native parameter-list commas from the default so the formatter host does not raise consumer PHP syntax. Existing commas and explicit callback-last replacement remain preserved. Qualified RED/GREEN, full local123tests/840assertions, current hosted PHP8.3/8.4/8.5/reusable/Changelog/CodeQL and exact-head Codex code/security are successful. No consumer mutation, blocked multiline code, merge, tag or release.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coisa
coisa marked this pull request as ready for review October 27, 2026 06:18
@coisa
coisa merged commit 474f891 into main Oct 27, 2026
42 checks passed
@coisa
coisa deleted the codex/consumer-language-compatibility branch October 27, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant