Skip to content

Fix: format .stub files correctly with pint#28

Merged
juzaweb merged 3 commits intomasterfrom
fix/format-stub-files-12349054718455313398
Mar 19, 2026
Merged

Fix: format .stub files correctly with pint#28
juzaweb merged 3 commits intomasterfrom
fix/format-stub-files-12349054718455313398

Conversation

@juzaweb
Copy link
Copy Markdown
Owner

@juzaweb juzaweb commented Mar 18, 2026

Fixes an issue where pint formatting would fail or produce incorrectly formatted files when running commands that generated code from .stub files. Formatted the .stub files with pint by first swapping template variables to valid PHP strings, letting pint run, and replacing the original templates back.


PR created automatically by Jules for task 12349054718455313398 started by @juzaweb

- Temporarily converted `$VAR$` placeholders in `stubs/` to valid PHP format tokens, renamed files to `.php`, ran `vendor/bin/pint`, and reverted placeholders back to their original form.
- This ensures the generated files from these templates conform to the codebase style rules without throwing pint errors when run after generation.
- Excluded paths like `use $VAR$;` to prevent pint from breaking them.

Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 2 commits March 19, 2026 02:38
- Temporarily converted `$VAR$` placeholders in `stubs/` to valid PHP format tokens, renamed files to `.php`, ran `vendor/bin/pint`, and reverted placeholders back to their original form.
- This ensures the generated files from these templates conform to the codebase style rules without throwing pint errors when run after generation.
- Excluded paths like `use $VAR$;` to prevent pint from breaking them.

Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com>
- Temporarily converted `$VAR$` placeholders in `stubs/` to valid PHP format tokens, renamed files to `.php`, ran `vendor/bin/pint`, and reverted placeholders back to their original form.
- Passed custom config `pint.json` to pint with `no_superfluous_phpdoc_tags` and `single_line_empty_body` rules set to false to prevent pint from removing the original template empty methods and docblocks.
- Preserved `use $VAR$;` imports by protecting them from format erasure, preventing pint from deleting or garbling namespaces in controllers.
- This ensures generated files from templates conform to codebase style rules without throwing errors.

Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com>
@juzaweb juzaweb merged commit 2e63f18 into master Mar 19, 2026
2 checks passed
@juzaweb juzaweb deleted the fix/format-stub-files-12349054718455313398 branch March 19, 2026 04:17
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