Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 8054e96

Browse files
committed
Merge branch 'deploy/1.5.0' into productive
2 parents 94da429 + 6e6ceb3 commit 8054e96

File tree

15 files changed

+188
-178
lines changed

15 files changed

+188
-178
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

.swiftlint.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@ opt_in_rules:
44
- closure_spacing
55
- empty_count
66
- explicit_init
7-
- fatal_error_message
87
- file_header
98
- first_where
10-
- implicit_return
11-
- implicitly_unwrapped_optional
9+
- let_var_whitespace
1210
- nimble_operator
1311
- no_extension_access_modifier
1412
- number_separator
13+
- object_literal
1514
- operator_usage_whitespace
1615
- overridden_super_call
1716
- private_outlet
1817
- prohibited_super_call
1918
- redundant_nil_coalescing
19+
- sorted_imports
2020
- switch_case_on_newline
21+
- trailing_closure
22+
- unneeded_parentheses_in_closure_argument
23+
- vertical_parameter_alignment_on_call
24+
25+
disabled_rules:
26+
- todo
2127

2228
included:
2329
- Sources
@@ -26,19 +32,20 @@ included:
2632
excluded:
2733
- Carthage
2834
- Sources/Code/Extensions/ColorSpaces.swift
35+
- Package.swift
36+
- UsageExamples.playground
2937

30-
line_length: 180
38+
line_length: 160
3139

3240
file_header:
3341
required_pattern: |
3442
\/\/
3543
\/\/ .*?\.swift
36-
\/\/ [\S ]+
44+
\/\/ HandyUIKit
3745
\/\/
38-
\/\/ Created by .*? on \d{1,2}\.\d{1,2}\.\d{2}\.
39-
\/\/ Copyright © \d{4} [\S ]+\. All rights reserved\.
46+
\/\/ Created by .*? on \S{8,10}\.
47+
\/\/ Copyright © \d{4} Flinesoft\. All rights reserved\.
4048
\/\/
41-
4249
custom_rules:
4350
closing_brace_whitespace:
4451
included: ".*.swift"
@@ -52,12 +59,6 @@ custom_rules:
5259
name: "Unnecessary Closure Params Parantheses"
5360
message: "Don't use parantheses around non-typed parameters in a closure."
5461
severity: warning
55-
ending_closure:
56-
included: ".*.swift"
57-
regex: '(?:\(|, | *\S+ *: *)\{[^\}]+\}\) *\n'
58-
name: "Ending Closure"
59-
message: "Don't use '(' and ')' on the last closure of a method – remove them instead."
60-
severity: warning
6162
if_as_guard:
6263
included: ".*.swift"
6364
regex: '\n *if [^\{]+\{\s*return[^\n]*\n *\}(?! *else)'
@@ -70,15 +71,9 @@ custom_rules:
7071
name: "Late Force Unwrapping"
7172
message: "Don't use ? first to force unwrap later – directly unwrap within the parantheses."
7273
severity: warning
73-
long_switch_case:
74-
included: ".*.swift"
75-
regex: 'case (?:let )?\.[^\n]+\n((?!\s*switch)[^\n\}]+\n){5,}?\s*(case|\})'
76-
name: "Long Switch Cases"
77-
message: "Use a maximum of 3 lines within each case."
78-
severity: warning
7974
missing_docs:
8075
included: ".*.swift"
81-
regex: '\n *(?!\/\/\/)(\/\/)?[^\n\/]*\n *(?:public|open)'
76+
regex: '\n *(?!\/\/\/)(\/\/)?[^\n\/]*\n *(?:@\S+ )*(?:public |open )'
8277
name: "Missing Docs"
8378
message: "Types, properties and methods with public or open access level should be documented."
8479
severity: warning
@@ -88,24 +83,12 @@ custom_rules:
8883
name: "Multiple Closure Params"
8984
message: "Don't use multiple in-line closures – save one or more of them to variables instead."
9085
severity: warning
91-
return_whitespace:
92-
included: ".*.swift"
93-
regex: '( {4}\S[^\n]+\n){2,} {4}return|( {8}\S[^\n]+\n){2,} {8}return|( {12}\S[^\n]+\n){2,} {12}return|( {16}\S[^\n]+\n){2,} {16}return|( {20}\S[^\n]+\n){2,} {20}return|( {24}\S[^\n]+\n){2,} {24}return'
94-
name: "Return Whitespace"
95-
message: "Put an empty line before the return line if two or more other lines in closure."
96-
severity: warning
9786
single_line_guard:
9887
included: ".*.swift"
99-
regex: 'guard[^\{]{2,100}else\s*\{\s*\n\s*return.{2,60}\}'
88+
regex: 'guard[^\{]{2,80}else\s*\{\s*\n\s*return.{2,40}\}'
10089
name: "Single Line Guard"
10190
message: "Use a single line guard for simple checks."
10291
severity: warning
103-
space_before_comment:
104-
included: ".*.swift"
105-
regex: '\n[ ]{0}[^\/ \n][^\n]*\n[ ]{0}\/\/|\n[ ]{4}[^\/ \n][^\n]*\n[ ]{4}\/\/|\n[ ]{8}[^\/ \n][^\n]*\n[ ]{8}\/\/|\n[ ]{16}[^\/ \n][^\n]*\n[ ]{16}\/\/|\n[ ]{20}[^\/ \n][^\n]*\n[ ]{20}\/\/|\n[ ]{24}[^\/ \n][^\n]*\n[ ]{24}\/\/'
106-
name: "Space Before Comment"
107-
message: "Always put a space line before a comment line and always comment code beforehand."
108-
severity: warning
10992
too_much_indentation:
11093
included: ".*.swift"
11194
regex: '\n {0}[^\s\/][^\n]*[^,|&]\n+ {5,}\S|\n {4}[^\s\/][^\n]*[^,|&]\n+ {9,}\S|\n {8}[^\s\/][^\n]*[^,|&]\n+ {13,}\S|\n {12}[^\s\/][^\n]*[^,|&]\n+ {17,}\S|\n {16}[^\s\/][^\n]*[^,|&]\n+ {21,}\S|\n {20}[^\s\/][^\n]*[^,|&]\n+ {25,}\S'
@@ -114,7 +97,7 @@ custom_rules:
11497
severity: warning
11598
too_much_unindentation:
11699
included: ".*.swift"
117-
regex: ' {28}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,23}[^\s\/]| {24}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,19}[^\s\/]| {20}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,15}[^\s\/]| {16}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,11}[^\s\/]| {12}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,7}[^\s\/]| {8}\S(.|[^\n]*[^\)][^\ ][^\}])\n+ {0,3}[^\s\/]'
100+
regex: ' {28}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,23}[^\s\/]| {24}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,19}[^\s\/]| {20}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,15}[^\s\/]| {16}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,11}[^\s\/]| {12}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,7}[^\s\/]| {8}[^\s\.](.|[^\n]*[^\)][^\ ][^\}])\n+ {0,3}[^\s\/]'
118101
name: "Too Much Unindentation"
119102
message: "Don't unindent code by more than 4 whitespaces."
120103
severity: warning

HandyUIKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "HandyUIKit"
4-
s.version = "1.4.1"
4+
s.version = "1.5.0"
55
s.summary = "Handy UI features that should have been part of UIKit in the first place."
66

77
s.description = <<-DESC

HandyUIKit.xcodeproj/project.pbxproj

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@
194194
isa = PBXGroup;
195195
children = (
196196
A1F221791E3E15FA00419B06 /* README.md */,
197-
A1F221821E3FEDD600419B06 /* .swiftlint.yml */,
197+
A1F221861E3FEE8B00419B06 /* LICENSE.md */,
198198
A1F221831E3FEDF300419B06 /* Package.swift */,
199199
A1F221841E3FEE1C00419B06 /* HandyUIKit.podspec */,
200+
A1F221821E3FEDD600419B06 /* .swiftlint.yml */,
200201
A1F221881E3FEEA700419B06 /* .swift-version */,
201-
A1F221861E3FEE8B00419B06 /* LICENSE.md */,
202202
);
203203
name = "Root Files";
204204
sourceTree = "<group>";
@@ -239,7 +239,7 @@
239239
A14E0AB81E1F986A00DFC788 /* Frameworks */,
240240
A14E0AB91E1F986A00DFC788 /* Headers */,
241241
A14E0ABA1E1F986A00DFC788 /* Resources */,
242-
A1F2218C1E3FEF2800419B06 /* Run Swift Linter */,
242+
A1F2218C1E3FEF2800419B06 /* SwiftLint */,
243243
);
244244
buildRules = (
245245
);
@@ -276,7 +276,7 @@
276276
A14E0AD71E1F987C00DFC788 /* Frameworks */,
277277
A14E0AD81E1F987C00DFC788 /* Headers */,
278278
A14E0AD91E1F987C00DFC788 /* Resources */,
279-
A1F2218A1E3FEF1300419B06 /* Run Swift Linter */,
279+
A1F2218A1E3FEF1300419B06 /* SwiftLint */,
280280
);
281281
buildRules = (
282282
);
@@ -312,27 +312,29 @@
312312
isa = PBXProject;
313313
attributes = {
314314
LastSwiftUpdateCheck = 0820;
315-
LastUpgradeCheck = 0820;
315+
LastUpgradeCheck = 0900;
316316
ORGANIZATIONNAME = Flinesoft;
317317
TargetAttributes = {
318318
A14E0ABB1E1F986A00DFC788 = {
319319
CreatedOnToolsVersion = 8.2.1;
320-
LastSwiftMigration = 0820;
320+
LastSwiftMigration = 0900;
321321
ProvisioningStyle = Automatic;
322322
};
323323
A14E0AC41E1F986A00DFC788 = {
324324
CreatedOnToolsVersion = 8.2.1;
325325
DevelopmentTeam = 767S6EFMJ8;
326+
LastSwiftMigration = 0900;
326327
ProvisioningStyle = Automatic;
327328
};
328329
A14E0ADA1E1F987C00DFC788 = {
329330
CreatedOnToolsVersion = 8.2.1;
330-
LastSwiftMigration = 0820;
331+
LastSwiftMigration = 0900;
331332
ProvisioningStyle = Automatic;
332333
};
333334
A14E0AE21E1F987C00DFC788 = {
334335
CreatedOnToolsVersion = 8.2.1;
335336
DevelopmentTeam = 767S6EFMJ8;
337+
LastSwiftMigration = 0900;
336338
ProvisioningStyle = Automatic;
337339
};
338340
};
@@ -389,28 +391,28 @@
389391
/* End PBXResourcesBuildPhase section */
390392

391393
/* Begin PBXShellScriptBuildPhase section */
392-
A1F2218A1E3FEF1300419B06 /* Run Swift Linter */ = {
394+
A1F2218A1E3FEF1300419B06 /* SwiftLint */ = {
393395
isa = PBXShellScriptBuildPhase;
394396
buildActionMask = 2147483647;
395397
files = (
396398
);
397399
inputPaths = (
398400
);
399-
name = "Run Swift Linter";
401+
name = SwiftLint;
400402
outputPaths = (
401403
);
402404
runOnlyForDeploymentPostprocessing = 0;
403405
shellPath = /bin/sh;
404406
shellScript = "if [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n if which swiftlint > /dev/null; then\n swiftlint\n else\n echo \"SwiftLint not installed, download it from https://github.com/realm/SwiftLint\"\n fi\nfi";
405407
};
406-
A1F2218C1E3FEF2800419B06 /* Run Swift Linter */ = {
408+
A1F2218C1E3FEF2800419B06 /* SwiftLint */ = {
407409
isa = PBXShellScriptBuildPhase;
408410
buildActionMask = 2147483647;
409411
files = (
410412
);
411413
inputPaths = (
412414
);
413-
name = "Run Swift Linter";
415+
name = SwiftLint;
414416
outputPaths = (
415417
);
416418
runOnlyForDeploymentPostprocessing = 0;
@@ -491,15 +493,21 @@
491493
CLANG_CXX_LIBRARY = "libc++";
492494
CLANG_ENABLE_MODULES = YES;
493495
CLANG_ENABLE_OBJC_ARC = YES;
496+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
494497
CLANG_WARN_BOOL_CONVERSION = YES;
498+
CLANG_WARN_COMMA = YES;
495499
CLANG_WARN_CONSTANT_CONVERSION = YES;
496500
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
497501
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
498502
CLANG_WARN_EMPTY_BODY = YES;
499503
CLANG_WARN_ENUM_CONVERSION = YES;
500504
CLANG_WARN_INFINITE_RECURSION = YES;
501505
CLANG_WARN_INT_CONVERSION = YES;
506+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
507+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
502508
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
509+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
510+
CLANG_WARN_STRICT_PROTOTYPES = YES;
503511
CLANG_WARN_SUSPICIOUS_MOVE = YES;
504512
CLANG_WARN_UNREACHABLE_CODE = YES;
505513
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -529,6 +537,7 @@
529537
SDKROOT = iphoneos;
530538
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
531539
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
540+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
532541
TARGETED_DEVICE_FAMILY = "1,2";
533542
VERSIONING_SYSTEM = "apple-generic";
534543
VERSION_INFO_PREFIX = "";
@@ -544,15 +553,21 @@
544553
CLANG_CXX_LIBRARY = "libc++";
545554
CLANG_ENABLE_MODULES = YES;
546555
CLANG_ENABLE_OBJC_ARC = YES;
556+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
547557
CLANG_WARN_BOOL_CONVERSION = YES;
558+
CLANG_WARN_COMMA = YES;
548559
CLANG_WARN_CONSTANT_CONVERSION = YES;
549560
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
550561
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
551562
CLANG_WARN_EMPTY_BODY = YES;
552563
CLANG_WARN_ENUM_CONVERSION = YES;
553564
CLANG_WARN_INFINITE_RECURSION = YES;
554565
CLANG_WARN_INT_CONVERSION = YES;
566+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
567+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
555568
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
569+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
570+
CLANG_WARN_STRICT_PROTOTYPES = YES;
556571
CLANG_WARN_SUSPICIOUS_MOVE = YES;
557572
CLANG_WARN_UNREACHABLE_CODE = YES;
558573
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -574,6 +589,7 @@
574589
MTL_ENABLE_DEBUG_INFO = NO;
575590
SDKROOT = iphoneos;
576591
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
592+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
577593
TARGETED_DEVICE_FAMILY = "1,2";
578594
VALIDATE_PRODUCT = YES;
579595
VERSIONING_SYSTEM = "apple-generic";
@@ -599,7 +615,7 @@
599615
PRODUCT_NAME = HandyUIKit;
600616
SKIP_INSTALL = YES;
601617
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
602-
SWIFT_VERSION = 3.0;
618+
SWIFT_VERSION = 4.0;
603619
};
604620
name = Debug;
605621
};
@@ -620,7 +636,7 @@
620636
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKit;
621637
PRODUCT_NAME = HandyUIKit;
622638
SKIP_INSTALL = YES;
623-
SWIFT_VERSION = 3.0;
639+
SWIFT_VERSION = 4.0;
624640
};
625641
name = Release;
626642
};
@@ -633,7 +649,7 @@
633649
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
634650
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKitTests;
635651
PRODUCT_NAME = "$(TARGET_NAME)";
636-
SWIFT_VERSION = 3.0;
652+
SWIFT_VERSION = 4.0;
637653
};
638654
name = Debug;
639655
};
@@ -646,7 +662,7 @@
646662
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
647663
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKitTests;
648664
PRODUCT_NAME = "$(TARGET_NAME)";
649-
SWIFT_VERSION = 3.0;
665+
SWIFT_VERSION = 4.0;
650666
};
651667
name = Release;
652668
};
@@ -668,7 +684,7 @@
668684
SDKROOT = appletvos;
669685
SKIP_INSTALL = YES;
670686
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
671-
SWIFT_VERSION = 3.0;
687+
SWIFT_VERSION = 4.0;
672688
TARGETED_DEVICE_FAMILY = 3;
673689
TVOS_DEPLOYMENT_TARGET = 9.0;
674690
};
@@ -691,7 +707,7 @@
691707
PRODUCT_NAME = HandyUIKit;
692708
SDKROOT = appletvos;
693709
SKIP_INSTALL = YES;
694-
SWIFT_VERSION = 3.0;
710+
SWIFT_VERSION = 4.0;
695711
TARGETED_DEVICE_FAMILY = 3;
696712
TVOS_DEPLOYMENT_TARGET = 9.0;
697713
};
@@ -707,7 +723,7 @@
707723
PRODUCT_BUNDLE_IDENTIFIER = "com.flinesoft.HandyUIKit-tvOSTests";
708724
PRODUCT_NAME = "$(TARGET_NAME)";
709725
SDKROOT = appletvos;
710-
SWIFT_VERSION = 3.0;
726+
SWIFT_VERSION = 4.0;
711727
TVOS_DEPLOYMENT_TARGET = 10.1;
712728
};
713729
name = Debug;
@@ -722,7 +738,7 @@
722738
PRODUCT_BUNDLE_IDENTIFIER = "com.flinesoft.HandyUIKit-tvOSTests";
723739
PRODUCT_NAME = "$(TARGET_NAME)";
724740
SDKROOT = appletvos;
725-
SWIFT_VERSION = 3.0;
741+
SWIFT_VERSION = 4.0;
726742
TVOS_DEPLOYMENT_TARGET = 10.1;
727743
};
728744
name = Release;

HandyUIKit.xcodeproj/xcshareddata/xcschemes/HandyUIKit-iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

HandyUIKit.xcodeproj/xcshareddata/xcschemes/HandyUIKit-tvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)