Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ custom_rules:
- "AdapterSDKs/RevenueCatAdMob/Sources/.*\\.swift"
regex: '(?s)(?<!@_spi\(Internal\)\s)\bpublic\s+(?:indirect\s+)?enum\s+[A-Z]'

no_hardcoded_logger_strings:
included:
- "Sources/.*\\.swift"
- "RevenueCatUI/.*\\.swift"
excluded:
- Sources/Logging/Logger.swift
- Sources/Logging/Strings/
name: "No hardcoded Logger strings"
regex: 'Logger\.\w+\(\s*"'
match_kinds:
- identifier
message: "Use a *Strings.swift enum case instead of an inline string literal (see Sources/Logging/Strings/)."
severity: warning

no_leaking_rules_engine_internal_import:
included: ".*\\.swift"
name: "No leaking `import RulesEngineInternal`"
Expand Down
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,9 @@ When reviewing a pull request:
- **Check Android SDK** when unsure about cross-platform implementation details — new features should follow existing patterns across SDKs
- **Never commit Claude-related files** — do not stage or commit `.claude/` directory, `settings.local.json`, or any AI tool configuration files
- **Never commit API keys or secrets** — do not stage or commit API keys, tokens, credentials, or any sensitive data
- **Prefer the tightest access control** — default to `private`; only widen to `internal`/`public`/`@_spi` when callers outside the current scope actually need it. Every reviewer-requested visibility reduction is a missed opportunity to get it right the first time.
- **Avoid default parameter values on internal initializers** — they let callers silently omit arguments. Make every parameter explicit so the compiler catches missing values, especially when new parameters are added later.
- **Don't add code that nothing in the PR uses** — unused types, methods, or properties that "will be needed later" should be introduced in the PR that actually uses them. This keeps PRs reviewable and avoids dead code.

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.

This one might contradict PRs with 300 lines or less. I would remove it

- **Don't write redundant `Codable` implementations** — if the synthesized `init(from:)` or `encode(to:)` does what you need, omit the manual version. Custom implementations that just repeat the default add maintenance cost.
- **Avoid duplicating constants** — if a value already exists as a constant elsewhere, reference that single source of truth instead of defining a second copy. Duplicate literals are easy to miss when one copy changes.

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.

This one feels vague. Sometimes duplication in favor of better semantics make sense to me. What do you think? 🤔

- **Route all log strings through `*Strings.swift`** — `Logger` calls in `Sources/` and `RevenueCatUI/` must use a `*Strings.swift` enum case, not inline string literals (enforced by the `no_hardcoded_logger_strings` SwiftLint rule). See `Sources/Logging/Strings/` and `RevenueCatUI/Data/Strings.swift` for the pattern.
Loading