-
-
Notifications
You must be signed in to change notification settings - Fork 708
Expand file tree
/
Copy path.swiftlint.yml
More file actions
157 lines (149 loc) · 4.18 KB
/
.swiftlint.yml
File metadata and controls
157 lines (149 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
disabled_rules:
- block_based_kvo
- colon
- control_statement
- cyclomatic_complexity
- discarded_notification_center_observer
- file_length
- function_parameter_count
- generic_type_name
- identifier_name
- multiple_closures_with_trailing_closure
- nesting
- switch_case_alignment
- todo
- type_name
- unused_closure_parameter
# Threshold-configured rules — kept enabled at high tolerances (not in disabled_rules)
line_length: 200
type_body_length:
- 300 # warning
- 600 # error
function_body_length:
- 200 # warning
- 500 # error
large_tuple:
- 4 # warning
- 6 # error
opt_in_rules:
- closure_spacing
- contains_over_filter_count
- contains_over_filter_is_empty
- empty_count
- empty_string
- first_where
- force_unwrapping
- last_where
- toggle_bool
# Owned source — only first-party code, no submodules or vendored deps
included:
# App targets
- Provenance
- "Provenance Tests"
- "Provenance Mini Watch App"
- "Provenance Mini Watch AppTests"
- "Provenance Mini Watch AppUITests"
- "Provenance VR"
- ProvenanceTV
# PV* Swift Package modules
- PVAudio
- PVCheevos
- PVCoreAudio
- PVCoreBridge
- PVCoreBridgeRetro
- PVCoreLoader
- PVCoreObjCBridge
- PVEmulatorCore
- PVFeatureFlags
- PVHashing
- PVHelp
- PVJIT
- PVLibrary
- PVLogging
- PVLookup
- PVMacros
- PVObjCUtils
- PVPatching
- PVPatreon
- PVPlists
- PVPrimitives
- PVSettings
- PVShaders
- PVSupport
- PVThemes
- PVUI
- PVUSBManager
- PVWebServer
# Companion app
- ProvenanceCompanion
# Extensions (all first-party)
- Extensions/ActivityMonitorExtension
- Extensions/ActivityReportExtension
- Extensions/BackgroundDownloadExtension
- Extensions/macOS
- "Extensions/Provenance Stickers"
- Extensions/QuickLookPreview
- "Extensions/ROM File Provider"
- Extensions/Spotlight
- Extensions/SpotlightImportExtension
- Extensions/ThumbnailExtension
- Extensions/TopShelf
- Extensions/TopShelfv2
excluded:
- Carthage
- PVSupport/Carthage
- PVLibrary/Carthage
- Pods
- Cores # upstream emulator submodules — not our code
- CoresRetro # RetroArch submodule
- Dependencies # vendored third-party (ZipArchive, cubeb, FFMpeg, etc.)
- Scripts
- fastlane
- build
- archive
- .build
- .swiftpm
analyzer_rules: # Rules run by `swiftlint analyze`
- explicit_self
# Severity overrides
force_cast: warning
force_try: warning
empty_count: warning
empty_string: warning
reporter: "xcode" # override per-invocation with --reporter github-actions-logging in CI
custom_rules:
placeholders_in_comments:
included: ".*\\.swift"
name: "No Placeholders in Comments"
regex: "<#([^#]+)#>"
match_kinds:
- comment
- doccomment
message: "Placeholder left in comment."
severity: warning
tiles_deprecated:
included: ".*\\.swift"
name: "Tiles are deprecated in favor of Frame"
regex: "\\b[Tt]iles?\\b"
message: "Tiles are deprecated in favor of Frame"
severity: warning
unlocalized_text_init:
# Warn when Text() is called with a String variable/expression rather than a literal
# LocalizedStringKey. `Text(someVar)` bypasses localization; prefer
# `Text(verbatim: someVar)` (explicit non-localized) or change the property to
# return `LocalizedStringKey` / use `String(localized:)` at the call site.
#
# Pattern explanation:
# Text\( — SwiftUI Text initialiser
# (?!\" — NOT followed by a string literal (those are LocalizedStringKey)
# (?!verbatim: — NOT the explicit verbatim: label (intentionally non-localized)
# (?!String\( — NOT String(...) which may itself contain String(localized:)
# (?!Image — NOT Image(...) mistakenly flagged
#
# Scope: ProvenanceCompanion only (companion app owns its own localization).
included: ".*/ProvenanceCompanion/.*\\.swift"
excluded: ".*/Preview Content/.*"
name: "Potentially Unlocalized Text"
regex: "Text\\((?!\"|verbatim:|String\\(|Image)"
message: "Text() called with a non-literal argument — use Text(\"key\") (LocalizedStringKey) or Text(verbatim:) if intentionally unlocalized."
severity: warning