-
Notifications
You must be signed in to change notification settings - Fork 82
Add information about mocks to Claude configuration #2130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Claude finished @KatherineInCode's task —— View job PR Review CompleteThis PR successfully addresses the confusion around mock file placement by documenting the Xcodegen auto-inclusion behavior and Sourcery preference. The changes are clear, consistent, and directly aligned with the stated objective. 📝 SummaryDocumentation update clarifying mock generation and placement conventions across Claude configuration files and architecture documentation. Changes inform Claude (and developers) about Sourcery-based mock generation preference and the automatic inclusion of 🎨 Suggested ImprovementsFinding 1: Inconsistent specificity between CLAUDE.md and Architecture.md regarding "manual" mock implementations The Suggested rewording for Architecture.md- `BitwardenKitMocks`: Mock implementations for BitwardenKit components. Manual mock files placed in a `Mocks` folder in `BitwardenKit` will be automatically included in this target.
- `AuthenticatorBridgeKitMocks`: Mock implementations for AuthenticatorBridgeKit components. Manual mock files placed in a `Mocks` folder in `AuthenticatorBridgeKit` will be automatically included in this target.This clarifies that the statement applies specifically to manual mocks (since Sourcery-generated ones are handled differently in the build process). Finding 2: Potentially ambiguous wording in SKILL.md about Sourcery and Mocks folder relationship The Suggested rewording- Mocks are generated using Sourcery's `AutoMockable` annotation where possible; manual mocks are placed in a `Mocks` folder.This clarifies the preference hierarchy and relationship more precisely. ✅ Good Practices
📋 Action Items
|
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2130 +/- ##
==========================================
- Coverage 85.23% 83.77% -1.46%
==========================================
Files 1709 1970 +261
Lines 145424 160813 +15389
==========================================
+ Hits 123945 134727 +10782
- Misses 21479 26086 +4607 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| 1. Follow existing code style in surrounding files | ||
| 2. Write tests alongside implementation | ||
| 1. Prefer using Sourcery with the `AutoMockable` attribute for creating mocks. | ||
| 2. If a manual mock implementation is needed (not using Sourcery), place it in a `Mocks` folder within the appropriate framework directory, as our Xcodegen configuration will automatically include it in the correct test target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think this is true only for mocks that are for BitwardenKit or AuthenticatorBridgeKit targets. However, on other targets like BitwardenShared or AuthenticatorShared we have no Mocks folder; mocks are under TestHelpers folders and belong to their tests targets. Perhaps we should make that explicit here as well as it might create Mocks folders in those targets to follow this rule which would not be the current approach.

📔 Objective
I have noticed that Claude often generates comments that states that mock files aren't in the
BitwardenKitMocks(etc.) target, but are instead in aMocksfolder. This is because Claude has insufficient training data to understand our Xcodegen configurations.This attempts to update the Claude configurations to specify that we put mock files in
Mocksdirectories, and also to call out our preferred usage of Sourcery for mock generation.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes