Skip to content

Commit 5eb0fe8

Browse files
author
Aaron McTavish
committed
Update to SwiftLint 0.16.1
Also enables more rules now that they are more customisable.
1 parent 93794c9 commit 5eb0fe8

File tree

60 files changed

+127
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+127
-78
lines changed

.swiftlint.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
disabled_rules:
22
- line_length
33
- nesting
4-
- trailing_whitespace
5-
- vertical_whitespace
64
opt_in_rules:
75
- attributes
6+
- closure_end_indentation
87
- closure_spacing
98
- conditional_returns_on_newline
109
- empty_count
1110
- explicit_init
11+
- file_header
12+
- first_where
1213
- number_separator
14+
- object_literal
1315
- overridden_super_call
1416
- private_outlet
1517
- prohibited_super_call
@@ -26,7 +28,21 @@ attributes:
2628
- '@NSManaged'
2729
- '@nonobjc'
2830
- '@objc'
31+
32+
file_header:
33+
required_pattern: |
34+
\/\/
35+
\/\/ .*?\.swift
36+
\/\/ FormValidatorSwift
37+
\/\/
38+
\/\/ Created by .*? on \d{1,2}\/\d{1,2}\/\d{4}\.
39+
\/\/ Copyright © \d{4} ustwo Fampany Ltd\. All rights reserved\.
40+
\/\/
41+
2942
line_length: 110
43+
trailing_whitespace:
44+
ignores_empty_lines: true
45+
ignores_comments: true
3046
type_body_length:
3147
- 300 # warning
3248
- 400 # error
@@ -36,3 +52,5 @@ variable_name_max_length:
3652
variable_name_min_length:
3753
- 3 # warning
3854
- 2 # error
55+
vertical_whitespace:
56+
max_empty_lines: 2

Example/iOS/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// AppDelegate.swift
3-
// iOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 14/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import UIKit

Example/iOS/FormAccessibility.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormAccessibility.swift
3-
// iOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 14/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Example/iOS/FormEntryView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormEntryView.swift
3-
// iOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 15/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import UIKit

Example/iOS/FormView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormView.swift
3-
// iOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 14/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import UIKit

Example/iOS/FormViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// ViewController.swift
3-
// iOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 14/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import UIKit

Example/macOS/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// AppDelegate.swift
3-
// macOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 06/01/2017.
6-
// Copyright © 2017 Ustwo Fampany Ltd. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Cocoa

Example/macOS/FormAccessibility.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormAccessibility.swift
3-
// macOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 06/01/2017.
6-
// Copyright © 2017 Ustwo Fampany Ltd. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Example/macOS/FormEntryView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormEntryView.swift
3-
// macOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 06/01/2017.
6-
// Copyright © 2017 Ustwo Fampany Ltd. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import AppKit

Example/macOS/FormView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormView.swift
3-
// macOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 06/01/2017.
6-
// Copyright © 2017 Ustwo Fampany Ltd. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import AppKit

Example/macOS/FormViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// FormViewController.swift
3-
// macOS Example
3+
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 06/01/2017.
6-
// Copyright © 2017 Ustwo Fampany Ltd. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import AppKit

FormValidatorSwift.xcodeproj/project.pbxproj

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@
707707
0056755B1C47ED32005A43F0 /* Frameworks */,
708708
0056755C1C47ED32005A43F0 /* Headers */,
709709
0056755D1C47ED32005A43F0 /* Resources */,
710+
003E91A61E37633100CEC946 /* SwiftLint */,
710711
);
711712
buildRules = (
712713
);
@@ -743,7 +744,7 @@
743744
0062E9CC1C45493E00021C0A /* Frameworks */,
744745
0062E9CD1C45493E00021C0A /* Headers */,
745746
0062E9CE1C45493E00021C0A /* Resources */,
746-
0032C1081C4553920023DB19 /* ShellScript */,
747+
0032C1081C4553920023DB19 /* SwiftLint */,
747748
);
748749
buildRules = (
749750
);
@@ -780,6 +781,7 @@
780781
00AC81E41E1FB69200A184BB /* Frameworks */,
781782
00AC81E51E1FB69200A184BB /* Headers */,
782783
00AC81E61E1FB69200A184BB /* Resources */,
784+
003E91A71E37633E00CEC946 /* SwiftLint */,
783785
);
784786
buildRules = (
785787
);
@@ -929,13 +931,42 @@
929931
/* End PBXResourcesBuildPhase section */
930932

931933
/* Begin PBXShellScriptBuildPhase section */
932-
0032C1081C4553920023DB19 /* ShellScript */ = {
934+
0032C1081C4553920023DB19 /* SwiftLint */ = {
933935
isa = PBXShellScriptBuildPhase;
934936
buildActionMask = 2147483647;
935937
files = (
936938
);
937939
inputPaths = (
938940
);
941+
name = SwiftLint;
942+
outputPaths = (
943+
);
944+
runOnlyForDeploymentPostprocessing = 0;
945+
shellPath = /bin/sh;
946+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
947+
};
948+
003E91A61E37633100CEC946 /* SwiftLint */ = {
949+
isa = PBXShellScriptBuildPhase;
950+
buildActionMask = 2147483647;
951+
files = (
952+
);
953+
inputPaths = (
954+
);
955+
name = SwiftLint;
956+
outputPaths = (
957+
);
958+
runOnlyForDeploymentPostprocessing = 0;
959+
shellPath = /bin/sh;
960+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
961+
};
962+
003E91A71E37633E00CEC946 /* SwiftLint */ = {
963+
isa = PBXShellScriptBuildPhase;
964+
buildActionMask = 2147483647;
965+
files = (
966+
);
967+
inputPaths = (
968+
);
969+
name = SwiftLint;
939970
outputPaths = (
940971
);
941972
runOnlyForDeploymentPostprocessing = 0;

Sources/Conditions/AlphabeticCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 12/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/AlphanumericCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/CreditCardCondition.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// CreditCardCondition.swift
33
// FormValidatorSwift
44
//
5-
// Created by Onur Ersel on 2016-11-02.
6-
// Copyright © 2016 ustwo. All rights reserved.
5+
// Created by Onur Ersel on 02/11/2016.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/EmailCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/Logic/AndCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/Logic/NotCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/Logic/OrCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/NumericCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/PasswordStrengthCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/PostcodeCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/PresentCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/RangeCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/URLCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Conditions/URLShorthandCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 13/01/2016.
6-
// Copyright © 2016 ustwo. All rights reserved.
6+
// Copyright © 2016 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Configurations/AlphabeticConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 03/01/2017.
6-
// Copyright © 2017 ustwo. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Configurations/AlphanumericConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 03/01/2017.
6-
// Copyright © 2017 ustwo. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

Sources/Configurations/CreditCardConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FormValidatorSwift
44
//
55
// Created by Aaron McTavish on 04/01/2017.
6-
// Copyright © 2017 ustwo. All rights reserved.
6+
// Copyright © 2017 ustwo Fampany Ltd. All rights reserved.
77
//
88

99
import Foundation

0 commit comments

Comments
 (0)