Skip to content

feat: enforce SRP file-function name match in CodeRabbit#400

Merged
sweetmantech merged 2 commits into
testfrom
feat/coderabbit-srp-file-name-match
Apr 6, 2026
Merged

feat: enforce SRP file-function name match in CodeRabbit#400
sweetmantech merged 2 commits into
testfrom
feat/coderabbit-srp-file-name-match

Conversation

@recoup-coding-agent

@recoup-coding-agent recoup-coding-agent commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add explicit CodeRabbit rule requiring exported function names to match file names
  • Updated SRP custom check, lib/**/*.ts path instructions, and lib/supabase/**/*.ts path instructions
  • Addresses PR #399 comment where buildAuthConfigs was added to getConnectors.ts instead of its own file

Test plan

  • Verify CodeRabbit picks up the new rule on future PRs
  • Confirm CodeRabbit flags functions added to files with mismatched names

🤖 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.yaml rules under SRP, domain functions, and Supabase for lib/**/*.ts and lib/supabase/**/*.ts to 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.

@vercel

vercel Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Apr 6, 2026 4:41pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .coderabbit.yaml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12487de5-1464-43db-b6c3-4af3384217d9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/coderabbit-srp-file-name-match

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread .coderabbit.yaml Outdated
- 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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the critical note. It's noise.

CTO Agent and others added 2 commits April 6, 2026 11:39
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>
@sweetmantech sweetmantech force-pushed the feat/coderabbit-srp-file-name-match branch from d0034ad to fb14dbd Compare April 6, 2026 16:40
@sweetmantech sweetmantech merged commit d01ff28 into test Apr 6, 2026
3 of 5 checks passed
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