Skip to content

Extract CodeGen namespace from LintMixinCommand#1716

Open
alganet wants to merge 1 commit intoRespect:3.1from
alganet:codegen
Open

Extract CodeGen namespace from LintMixinCommand#1716
alganet wants to merge 1 commit intoRespect:3.1from
alganet:codegen

Conversation

@alganet
Copy link
Member

@alganet alganet commented Mar 5, 2026

This change introduces no BC break.

Attributes from src-dev are not used in runtime, so it's fine for them to be referenced by files in src for now.

Goal here is to start shaping a Respect/CodeGen project that can move all of this complexity outside of Validation and also support projects like Respect/StringFormatter later.


Replace hardcoded validator class lists with a declarative #[Mixin] attribute and extract the mixin generation logic into a reusable CodeGen namespace under src-dev/CodeGen/.

The new MixinGenerator discovers prefix definitions and filtering rules by scanning #[Mixin] attributes on the target namespace's classes, removing the need for hardcoded configuration. It supports configurable interface types (Builder for __callStatic, Chain for __call) with custom suffixes, return types, and root extends.

This is the first step toward extracting the code generation into a standalone package that can map __call/__callStatic to any namespace, possibly for Respect/StringFormatter and any kind of project in the future.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.45%. Comparing base (84d7436) to head (dd4b9ac).
⚠️ Report is 1 commits behind head on 3.1.

Additional details and impacted files
@@            Coverage Diff            @@
##                3.1    #1716   +/-   ##
=========================================
  Coverage     99.45%   99.45%           
  Complexity     1015     1015           
=========================================
  Files           194      194           
  Lines          2384     2384           
=========================================
  Hits           2371     2371           
  Misses           13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alganet alganet requested a review from Copilot March 5, 2026 17:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@alganet alganet requested a review from Copilot March 5, 2026 20:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replace hardcoded validator class lists with a declarative #[Mixin]
attribute and extract the mixin generation logic into a reusable
CodeGen namespace under src-dev/CodeGen/.

The new MixinGenerator discovers prefix definitions and filtering
rules by scanning #[Mixin] attributes on the target namespace's
classes, removing the need for hardcoded configuration. It supports
configurable interface types (Builder for __callStatic, Chain for
__call) with custom suffixes, return types, and root extends.

This is the first step toward extracting the code generation into a
standalone package that can map __call/__callStatic to any namespace,
possibly for Respect/StringFormatter and any kind of project in the
future.
@alganet alganet marked this pull request as ready for review March 5, 2026 21:10
@alganet alganet requested a review from henriquemoody March 5, 2026 21:10
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.

2 participants