From 64515250147d9d519e546d1b0d24ec8b8b1da9fd Mon Sep 17 00:00:00 2001 From: CTO Agent Date: Mon, 6 Apr 2026 16:30:06 +0000 Subject: [PATCH 1/2] feat: add SRP file-function name match rule to CodeRabbit config 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 --- .coderabbit.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 499aa7e6c..5752ce611 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -32,6 +32,7 @@ reviews: - 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`. ## Open/Closed Principle (OCP) - Classes should be open for extension but closed for modification @@ -88,6 +89,7 @@ reviews: For domain functions, ensure: - Pure functions when possible - Single responsibility per function + - **File naming rule: The file name MUST match the exported function name.** If a new function is defined in a file whose name does not match, leave a review comment telling the developer to create a new file named after the function. For example, `buildAuthConfigs` must be in `buildAuthConfigs.ts`, not added to `getConnectors.ts`. - Proper error handling - Use TypeScript for type safety - Avoid side effects @@ -100,7 +102,7 @@ reviews: instructions: | For Supabase operations, ensure: - Follow naming convention: select*, insert*, update*, delete*, get* (for complex queries) - - One exported function per file + - One exported function per file — the file name MUST match the exported function name - Import serverClient only within lib/supabase/ - Return typed results using Tables<"table_name"> - Handle errors gracefully From fb14dbda1b54477371e1adac9f4410b40c246a4f Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Mon, 6 Apr 2026 11:39:48 -0500 Subject: [PATCH 2/2] fix: remove CRITICAL noise from SRP file-naming rule Co-Authored-By: Claude Opus 4.6 (1M context) --- .coderabbit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 5752ce611..fc14992ee 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -32,7 +32,7 @@ reviews: - 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`. + - File-function name match: 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. 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`. ## Open/Closed Principle (OCP) - Classes should be open for extension but closed for modification