-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy path.swiftlint.yml
More file actions
73 lines (63 loc) · 2.04 KB
/
Copy path.swiftlint.yml
File metadata and controls
73 lines (63 loc) · 2.04 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
strict: true
included:
- supacode
- supacode-cli
- supacodeTests
- SupacodeSettingsShared
- SupacodeSettingsFeature
excluded:
- ThirdParty/ghostty
# Skill content contains long markdown lines inside multiline strings.
- supacode/Features/Settings/BusinessLogic/CLISkillContent.swift
- SupacodeSettingsShared/BusinessLogic/CLISkillContent.swift
disabled_rules:
- file_length
- closure_parameter_position
- type_body_length
- trailing_comma
opt_in_rules:
- accessibility_label_for_image
- accessibility_trait_for_button
- async_without_await
- reduce_into
opening_brace:
ignore_multiline_function_signatures: true
ignore_multiline_statement_conditions: true
ignore_multiline_type_headers: true
cyclomatic_complexity:
warning: 15
error: 20
function_body_length:
warning: 100
error: 150
nesting:
type_level: 2
identifier_name:
max_length:
warning: 50
error: 60
excluded:
- id
- up
redundant_discardable_let:
ignore_swiftui_view_bodies: true
custom_rules:
store_state_mutation_in_views:
name: "Store State Mutation In Views"
regex: "\\bstore\\.[A-Za-z0-9_]+\\s*(?:\\+=|-=|\\*=|/=|=(?!=))"
message: "Do not mutate store state directly in views. Send actions instead."
severity: error
included: "supacode/.*/Views/.*\\.swift"
# Two signals, both required: the declaration is indented into a body (4+
# spaces, since even a nested view struct's own members sit at 4), and it
# carries no access modifier (Swift forbids one on a local, so a `private`
# stored property is exempt at any nesting depth).
shared_construction_in_view_body:
name: "Shared Construction In View Body"
regex: "^\\s{4,}@(Shared|SharedReader)\\(.*\\)\\s+var\\s"
message: >
Do not construct @Shared in a body, computed property, or function: references are cached
weakly, so the key's load (a disk read) re-runs on every evaluation. Hold it as a private
stored property on the view, or resolve it in the reducer and pass a value.
severity: error
included: ".*/Views/.*\\.swift"