new sniff to remove whitspace from start of functions#2827
Conversation
📝 WalkthroughWalkthroughA new PHP_CodeSniffer sniff is introduced that detects and automatically fixes blank lines immediately after function and closure opening braces. The sniff is registered in the ruleset to enforce this whitespace standard. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@phpcs-sniffs/Formidable/Sniffs/WhiteSpace/NoBlankLineAfterFunctionOpenSniff.php`:
- Around line 91-97: Replace the hardcoded "\n" used in the fixer replacement
with the file's EOL char to preserve CRLF/other line endings: when computing
$newlineCount/$content and calling $phpcsFile->fixer->replaceToken($nextToken,
"\n" . $indent), use $phpcsFile->eolChar instead of "\n" (e.g., build
replacement as $phpcsFile->eolChar . $indent) so the fixer output respects
original line endings.
I thought I had this already.
Either way, it seems to have been applied in Lite because there are no issues in this repo.
Summary by CodeRabbit
New Features
✏️ Tip: You can customize this high-level summary in your review settings.