-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.swiftlint.yml
More file actions
103 lines (90 loc) · 2.03 KB
/
.swiftlint.yml
File metadata and controls
103 lines (90 loc) · 2.03 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
# SwiftLint Configuration for Anchor
# https://github.com/realm/SwiftLint
# Paths to include during linting
included:
- Anchor
- AnchorKit/Sources
- AnchorMobile
# Paths to ignore during linting.
excluded:
- AnchorKit/Tests
- AnchorTests
- AnchorUITests
- Pods
- .build
- Carthage
- Package.swift
- "*/Package.swift"
- "**/DerivedData"
- "**/Build"
- "**/.build"
- "**/*.derived"
- "**/runner.swift"
- "**/GeneratedAssetSymbols.swift"
- "**/*-OutputFileMap.json"
- "**/**/runner.swift"
- "**/DerivedSources"
- "**/*Tests*"
- "**/*Test*"
- "**/PlaceCategorization.swift" # Complex domain logic with acceptable complexity
# Rules to disable
disabled_rules:
- trailing_whitespace # Can be auto-fixed by Xcode
- multiple_closures_with_trailing_closure # Common and idiomatic in SwiftUI
# Rules to enable that are opt-in
opt_in_rules:
- empty_count
- explicit_init
- first_where
- literal_expression_end_indentation
- operator_usage_whitespace
- redundant_nil_coalescing
- sorted_first_last
- toggle_bool
- unused_optional_binding
- vertical_parameter_alignment_on_call
- force_try
# Customized rules
line_length:
warning: 120 # Match CI expectations
error: 160
ignores_urls: true
ignores_function_declarations: true
ignores_comments: true
function_body_length:
warning: 60
error: 100
type_body_length:
warning: 300
error: 400
file_length:
warning: 400
error: 500
cyclomatic_complexity:
warning: 10
error: 20
identifier_name:
min_length:
warning: 1
error: 1
excluded:
- id
- x
- y
- z
# OAuth 2.0 standard field names (snake_case per RFC 6749)
- access_token
- refresh_token
- expires_in
- token_type
- pds_url
- session_id
- display_name
# Custom rules could go here if needed in the future
# Performance and quality rules specific to location and networking code
force_cast:
severity: error
# Allow longer parameter lists for AT Protocol request models
function_parameter_count:
warning: 8
error: 12