feat: enforce SRP file-function name match in CodeRabbit#400
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Low-risk configuration update to CodeRabbit rules for enforcing file-function naming consistency. No impact on production code or infrastructure.
| - Functions should do one thing and do it well | ||
| - Avoid god classes or functions with multiple responsibilities | ||
| - Look for functions longer than 20 lines or classes with >200 lines | ||
| - **File-function name match (CRITICAL):** Each file must export ONE primary function, and the file name must match that function's name. If a new function is added to an existing file and its name does not match the file name, flag it immediately. The developer must create a new file named after the function instead of adding it to an existing file. Example: a function called `buildAuthConfigs` must live in `buildAuthConfigs.ts`, NOT in `getConnectors.ts`. |
There was a problem hiding this comment.
Remove the critical note. It's noise.
Add explicit rules requiring exported function names to match their file names. CodeRabbit will now flag when a function is added to a file with a different name and instruct devs to create a new file instead. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d0034ad to
fb14dbd
Compare
Summary
lib/**/*.tspath instructions, andlib/supabase/**/*.tspath instructionsbuildAuthConfigswas added togetConnectors.tsinstead of its own fileTest plan
🤖 Generated with Claude Code
Summary by cubic
Enforces a strict file-function naming rule in CodeRabbit: each TS file exports one primary function, and the file name must match that function.
Updates
.coderabbit.yamlrules under SRP, domain functions, and Supabase forlib/**/*.tsandlib/supabase/**/*.tsto flag mismatches and instruct creating a new file; also softens wording to avoid noisy critical alerts.Written for commit fb14dbd. Summary will update on new commits.