Skip to content

llm: Capture review learnings on alphabetization, comments, localization, and what-not-to-test#2612

Open
SaintPatrck wants to merge 2 commits into
mainfrom
llm/code-review-learnings
Open

llm: Capture review learnings on alphabetization, comments, localization, and what-not-to-test#2612
SaintPatrck wants to merge 2 commits into
mainfrom
llm/code-review-learnings

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

🎟️ Tracking

No ticket — captures review learnings from #2573.

📔 Objective

Roll learnings from PR #2573 review into the project's iOS skill set so the same feedback doesn't have to be given on every new feature PR.

Style guidance (.claude/skills/reviewing-changes/reference/ios-style-patterns.md):

  • New "Alphabetization" section citing the contributing.bitwarden.com Swift style guide, with the raw-type-imposes-order carve-out.
  • Tightened "TODO Comments" — the referenced ticket should be the ticket where the work will land, not the umbrella epic.
  • New "Comments" section — comments document why current code is the way it is, not what future PRs will add.
  • New "Localization" section citing the localization style anchor — keys mirror English, translator-facing comments target translators.

Testing guidance (.claude/skills/testing-ios-code/references/testing-gotchas.md):

  • New "Don't Test Swift-Synthesized Conformances" section. Tests should pin project behavior (server contracts, custom encoding, business logic), not Swift's auto-synthesized Codable / CaseIterable for plain raw-value enums. Includes a worked BankAccountType-style example and explicit carve-outs for non-synthesized cases.

Feature-review checklist (.claude/skills/reviewing-changes/checklists/feature-addition.md):

  • Code-quality bullets extended to flag alphabetization, language-feature tests, and localization-key conventions during review.

@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label May 4, 2026
@github-actions github-actions Bot added the t:llm Change Type - LLM related change (e.g. CLAUDE.md files) label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Documentation-only PR adding guidance to three iOS skill files: alphabetization rules, comment intent, localization key conventions, tightened TODO-ticket guidance, and a "don't test Swift-synthesized conformances" gotcha. Cross-references between the checklist, style-patterns, and testing-gotchas files line up. Statements about Swift's Codable/CaseIterable synthesis are accurate, and the most recent commit already addresses prior reviewer feedback (within-group ordering carve-out and replacing bank-account examples with generic Status/Archive stand-ins).

Code Review Details

No findings.

@SaintPatrck SaintPatrck marked this pull request as ready for review May 4, 2026 19:11
@SaintPatrck SaintPatrck requested review from a team as code owners May 4, 2026 19:11
Source: [contributing.bitwarden.com — Swift style: Alphabetization](https://contributing.bitwarden.com/contributing/code-style/swift#alphabetization).

- [ ] Enum cases are alphabetized — unless the raw type encodes ordering (e.g., `Int` raw values that line up with server error codes or persisted indices). Document the carve-out inline if you take it.
- [ ] Tests within a test file are alphabetized by function name.
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.

🤔 Except in cases where they're not—in particular, within a group of tests for a function, we'll sometimes put the error-case tests at the end.

```swift
@Test
func rawValues_matchServerContract() {
#expect(BankAccountType.checking.rawValue == "checking")
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.

🤔 Is there a way we could make this generic instead of referencing explicit bank account types?


Source: [contributing.bitwarden.com — Swift style: Localization](https://contributing.bitwarden.com/contributing/code-style/swift#localization).

- [ ] Localization keys mirror the English string closely. `BankAccount` for "Bank account", not `TypeBankAccount` or `BankAccountTitle`.
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.

🤔 Could we make this generic instead of referencing bank accounts?

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.21%. Comparing base (990fa63) to head (75ed950).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2612      +/-   ##
==========================================
- Coverage   87.21%   86.21%   -1.00%     
==========================================
  Files        1898     2125     +227     
  Lines      168089   183829   +15740     
==========================================
+ Hits       146599   158491   +11892     
- Misses      21490    25338    +3848     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…c examples

- Note that error-case tests within a per-function group are commonly placed at the end rather than strictly alphabetized.
- Replace BankAccount-specific examples with generic Status/Archive stand-ins so the docs don't go stale when the feature ships.
Comment on lines +34 to +39
## Localization

Source: [contributing.bitwarden.com — Swift style: Localization](https://contributing.bitwarden.com/contributing/code-style/swift#localization).

- [ ] Localization keys mirror the English string closely. `BankAccount` for "Bank account", not `TypeBankAccount` or `BankAccountTitle`.
- [ ] Translator-facing comments (`/* … */` above a key) describe meaning, placement, or constraints that affect translation — not internal phasing or ticket bookkeeping. Translators are the audience.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎨 We use DescriptionLong suffix for string keys that would be really long if they'd mirror the English string value. I would say more than 70 or 80 characters would need this suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow t:llm Change Type - LLM related change (e.g. CLAUDE.md files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants