forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LegacyConstantRuleExamples.swift
66 lines (60 loc) · 1.79 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
56
57
58
59
60
61
62
63
64
65
66
//
// LegacyConstantRuleExamples.swift
// SwiftLint
//
// Created by Aaron McTavish on 01/16/17.
// Copyright © 2017 Realm. All rights reserved.
//
import Foundation
internal struct LegacyConstantRuleExamples {
static let nonTriggeringExamples = [
"CGRect.infinite",
"CGPoint.zero",
"CGRect.zero",
"CGSize.zero",
"NSPoint.zero",
"NSRect.zero",
"NSSize.zero",
"CGRect.null",
"CGFloat.pi",
"Float.pi"
]
static let triggeringExamples = [
"↓CGRectInfinite",
"↓CGPointZero",
"↓CGRectZero",
"↓CGSizeZero",
"↓NSZeroPoint",
"↓NSZeroRect",
"↓NSZeroSize",
"↓CGRectNull",
"↓CGFloat(M_PI)",
"↓Float(M_PI)"
]
static let corrections = [
"↓CGRectInfinite": "CGRect.infinite",
"↓CGPointZero": "CGPoint.zero",
"↓CGRectZero": "CGRect.zero",
"↓CGSizeZero": "CGSize.zero",
"↓NSZeroPoint": "NSPoint.zero",
"↓NSZeroRect": "NSRect.zero",
"↓NSZeroSize": "NSSize.zero",
"↓CGRectNull": "CGRect.null",
"↓CGRectInfinite\n↓CGRectNull\n": "CGRect.infinite\nCGRect.null\n",
"↓CGFloat(M_PI)": "CGFloat.pi",
"↓Float(M_PI)": "Float.pi",
"↓CGFloat(M_PI)\n↓Float(M_PI)\n": "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"
]
}