mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
build(apple): enforce typed resources with SwiftLint
Add a focused .swiftlint.yml (custom rules only, no default style noise) flagging raw String(localized:) / LocalizedStringKey / systemName|systemImage literals, and wire it as a required pre-build phase that fails the build if SwiftLint is missing (brew install swiftlint). The phase prepends the Homebrew bin dirs since Xcode runs scripts with a minimal PATH. Runs clean on the current tree (0 violations).
This commit is contained in:
27
apple/.swiftlint.yml
Normal file
27
apple/.swiftlint.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# Focused lint for the native app: enforce the typed-resources convention only
|
||||
# (no default style rules, so this stays signal, not noise).
|
||||
only_rules:
|
||||
- custom_rules
|
||||
|
||||
included:
|
||||
- VniDrop
|
||||
|
||||
excluded:
|
||||
- VniDrop/Generated
|
||||
|
||||
custom_rules:
|
||||
raw_localized_string:
|
||||
name: "Raw localized key"
|
||||
regex: 'String\(localized:\s*"'
|
||||
message: "Use a typed L10n.* accessor, not a raw key string."
|
||||
severity: warning
|
||||
raw_localized_string_key:
|
||||
name: "Raw LocalizedStringKey"
|
||||
regex: 'LocalizedStringKey\("'
|
||||
message: "Use a typed L10n.* accessor instead of a raw key."
|
||||
severity: warning
|
||||
raw_sf_symbol:
|
||||
name: "Raw SF Symbol"
|
||||
regex: 'system(Name|Image):\s*"'
|
||||
message: "Use SFSafeSymbols: Image(systemSymbol:) or systemSymbol:."
|
||||
severity: warning
|
||||
Reference in New Issue
Block a user