forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLegacyConstantRuleExamples.swift
55 lines (52 loc) · 2.04 KB
/
LegacyConstantRuleExamples.swift
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
internal struct LegacyConstantRuleExamples {
static let nonTriggeringExamples: [Example] = [
Example("CGRect.infinite"),
Example("CGPoint.zero"),
Example("CGRect.zero"),
Example("CGSize.zero"),
Example("NSPoint.zero"),
Example("NSRect.zero"),
Example("NSSize.zero"),
Example("CGRect.null"),
Example("CGFloat.pi"),
Example("Float.pi")
]
static let triggeringExamples: [Example] = [
Example("↓CGRectInfinite"),
Example("↓CGPointZero"),
Example("↓CGRectZero"),
Example("↓CGSizeZero"),
Example("↓NSZeroPoint"),
Example("↓NSZeroRect"),
Example("↓NSZeroSize"),
Example("↓CGRectNull"),
Example("↓CGFloat(M_PI)"),
Example("↓Float(M_PI)")
]
static let corrections: [Example: Example] = [
Example("↓CGRectInfinite"): Example("CGRect.infinite"),
Example("↓CGPointZero"): Example("CGPoint.zero"),
Example("↓CGRectZero"): Example("CGRect.zero"),
Example("↓CGSizeZero"): Example("CGSize.zero"),
Example("↓NSZeroPoint"): Example("NSPoint.zero"),
Example("↓NSZeroRect"): Example("NSRect.zero"),
Example("↓NSZeroSize"): Example("NSSize.zero"),
Example("↓CGRectNull"): Example("CGRect.null"),
Example("↓CGRectInfinite\n↓CGRectNull\n"): Example("CGRect.infinite\nCGRect.null\n"),
Example("↓CGFloat(M_PI)"): Example("CGFloat.pi"),
Example("↓Float(M_PI)"): Example("Float.pi"),
Example("↓CGFloat(M_PI)\n↓Float(M_PI)\n"): Example("CGFloat.pi\nFloat.pi\n")
]
static let patterns = [
"CGRectInfinite": "CGRect.infinite",
"CGPointZero": "CGPoint.zero",
"CGRectZero": "CGRect.zero",
"CGSizeZero": "CGSize.zero",
"NSZeroPoint": "NSPoint.zero",
"NSZeroRect": "NSRect.zero",
"NSZeroSize": "NSSize.zero",
"CGRectNull": "CGRect.null",
"CGFloat\\(M_PI\\)": "CGFloat.pi",
"Float\\(M_PI\\)": "Float.pi"
]
}