-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy path.swiftlint.yml
More file actions
101 lines (85 loc) · 2.08 KB
/
.swiftlint.yml
File metadata and controls
101 lines (85 loc) · 2.08 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
# SwiftLint configuration for YouTube Music
# Matches AGENTS.md coding style requirements
disabled_rules:
- trailing_comma
- line_length
- opening_brace # Allow SwiftFormat's multi-line condition style
opt_in_rules:
- closure_spacing
- contains_over_first_not_nil
- empty_count
- empty_string
- first_where
- implicit_return
- last_where
- modifier_order
- overridden_super_call
- private_action
- private_outlet
- redundant_nil_coalescing
- sorted_first_last
- toggle_bool
- unused_import
- vertical_whitespace_closing_braces
- yoda_condition
included:
- Sources
- Tests
excluded:
- .build
- DerivedData
- Packages
- Sources/APIExplorer
# Rules configuration
identifier_name:
min_length: 1
max_length: 60
allowed_symbols:
- _
type_name:
min_length: 3
max_length: 50
file_length:
warning: 900
error: 1500
function_body_length:
warning: 100
error: 150
type_body_length:
warning: 700
error: 1000
cyclomatic_complexity:
warning: 15
error: 25
nesting:
type_level: 3
function_level: 3
# Custom rules to match AGENTS.md requirements
custom_rules:
no_navigation_view:
name: "No NavigationView"
regex: "NavigationView"
message: "Use NavigationSplitView or NavigationStack instead of NavigationView"
severity: error
no_dispatch_queue:
name: "No DispatchQueue"
regex: "DispatchQueue"
message: "Use Swift concurrency (async/await, MainActor) instead of DispatchQueue"
severity: error
excluded:
- "Sources/Kaset/Services/NetworkMonitor.swift" # NWPathMonitor requires DispatchQueue
no_print:
name: "No print statements"
regex: "\\bprint\\("
message: "Use DiagnosticsLogger instead of print()"
severity: warning
no_foreground_color:
name: "No foregroundColor"
regex: "\\.foregroundColor\\("
message: "Use .foregroundStyle() instead of .foregroundColor()"
severity: warning
no_corner_radius:
name: "No cornerRadius"
regex: "\\.cornerRadius\\("
message: "Use .clipShape(.rect(cornerRadius:)) instead of .cornerRadius()"
severity: warning