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

Commit

Permalink
Merge branch 'deploy/1.5.0' into productive
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Sep 26, 2017
2 parents 94da429 + 6e6ceb3 commit 8054e96
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
53 changes: 18 additions & 35 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@ opt_in_rules:
- closure_spacing
- empty_count
- explicit_init
- fatal_error_message
- file_header
- first_where
- implicit_return
- implicitly_unwrapped_optional
- let_var_whitespace
- nimble_operator
- no_extension_access_modifier
- number_separator
- object_literal
- operator_usage_whitespace
- overridden_super_call
- private_outlet
- prohibited_super_call
- redundant_nil_coalescing
- sorted_imports
- switch_case_on_newline
- trailing_closure
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call

disabled_rules:
- todo

included:
- Sources
Expand All @@ -26,19 +32,20 @@ included:
excluded:
- Carthage
- Sources/Code/Extensions/ColorSpaces.swift
- Package.swift
- UsageExamples.playground

line_length: 180
line_length: 160

file_header:
required_pattern: |
\/\/
\/\/ .*?\.swift
\/\/ [\S ]+
\/\/ HandyUIKit
\/\/
\/\/ Created by .*? on \d{1,2}\.\d{1,2}\.\d{2}\.
\/\/ Copyright © \d{4} [\S ]+\. All rights reserved\.
\/\/ Created by .*? on \S{8,10}\.
\/\/ Copyright © \d{4} Flinesoft\. All rights reserved\.
\/\/
custom_rules:
closing_brace_whitespace:
included: ".*.swift"
Expand All @@ -52,12 +59,6 @@ custom_rules:
name: "Unnecessary Closure Params Parantheses"
message: "Don't use parantheses around non-typed parameters in a closure."
severity: warning
ending_closure:
included: ".*.swift"
regex: '(?:\(|, | *\S+ *: *)\{[^\}]+\}\) *\n'
name: "Ending Closure"
message: "Don't use '(' and ')' on the last closure of a method – remove them instead."
severity: warning
if_as_guard:
included: ".*.swift"
regex: '\n *if [^\{]+\{\s*return[^\n]*\n *\}(?! *else)'
Expand All @@ -70,15 +71,9 @@ custom_rules:
name: "Late Force Unwrapping"
message: "Don't use ? first to force unwrap later – directly unwrap within the parantheses."
severity: warning
long_switch_case:
included: ".*.swift"
regex: 'case (?:let )?\.[^\n]+\n((?!\s*switch)[^\n\}]+\n){5,}?\s*(case|\})'
name: "Long Switch Cases"
message: "Use a maximum of 3 lines within each case."
severity: warning
missing_docs:
included: ".*.swift"
regex: '\n *(?!\/\/\/)(\/\/)?[^\n\/]*\n *(?:public|open)'
regex: '\n *(?!\/\/\/)(\/\/)?[^\n\/]*\n *(?:@\S+ )*(?:public |open )'
name: "Missing Docs"
message: "Types, properties and methods with public or open access level should be documented."
severity: warning
Expand All @@ -88,24 +83,12 @@ custom_rules:
name: "Multiple Closure Params"
message: "Don't use multiple in-line closures – save one or more of them to variables instead."
severity: warning
return_whitespace:
included: ".*.swift"
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'
name: "Return Whitespace"
message: "Put an empty line before the return line if two or more other lines in closure."
severity: warning
single_line_guard:
included: ".*.swift"
regex: 'guard[^\{]{2,100}else\s*\{\s*\n\s*return.{2,60}\}'
regex: 'guard[^\{]{2,80}else\s*\{\s*\n\s*return.{2,40}\}'
name: "Single Line Guard"
message: "Use a single line guard for simple checks."
severity: warning
space_before_comment:
included: ".*.swift"
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}\/\/'
name: "Space Before Comment"
message: "Always put a space line before a comment line and always comment code beforehand."
severity: warning
too_much_indentation:
included: ".*.swift"
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'
Expand All @@ -114,7 +97,7 @@ custom_rules:
severity: warning
too_much_unindentation:
included: ".*.swift"
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\/]'
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\/]'
name: "Too Much Unindentation"
message: "Don't unindent code by more than 4 whitespaces."
severity: warning
Expand Down
2 changes: 1 addition & 1 deletion HandyUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

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

s.description = <<-DESC
Expand Down
54 changes: 35 additions & 19 deletions HandyUIKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@
isa = PBXGroup;
children = (
A1F221791E3E15FA00419B06 /* README.md */,
A1F221821E3FEDD600419B06 /* .swiftlint.yml */,
A1F221861E3FEE8B00419B06 /* LICENSE.md */,
A1F221831E3FEDF300419B06 /* Package.swift */,
A1F221841E3FEE1C00419B06 /* HandyUIKit.podspec */,
A1F221821E3FEDD600419B06 /* .swiftlint.yml */,
A1F221881E3FEEA700419B06 /* .swift-version */,
A1F221861E3FEE8B00419B06 /* LICENSE.md */,
);
name = "Root Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -239,7 +239,7 @@
A14E0AB81E1F986A00DFC788 /* Frameworks */,
A14E0AB91E1F986A00DFC788 /* Headers */,
A14E0ABA1E1F986A00DFC788 /* Resources */,
A1F2218C1E3FEF2800419B06 /* Run Swift Linter */,
A1F2218C1E3FEF2800419B06 /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -276,7 +276,7 @@
A14E0AD71E1F987C00DFC788 /* Frameworks */,
A14E0AD81E1F987C00DFC788 /* Headers */,
A14E0AD91E1F987C00DFC788 /* Resources */,
A1F2218A1E3FEF1300419B06 /* Run Swift Linter */,
A1F2218A1E3FEF1300419B06 /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -312,27 +312,29 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Flinesoft;
TargetAttributes = {
A14E0ABB1E1F986A00DFC788 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
A14E0AC41E1F986A00DFC788 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 767S6EFMJ8;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
A14E0ADA1E1F987C00DFC788 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
A14E0AE21E1F987C00DFC788 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 767S6EFMJ8;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -389,28 +391,28 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
A1F2218A1E3FEF1300419B06 /* Run Swift Linter */ = {
A1F2218A1E3FEF1300419B06 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Swift Linter";
name = SwiftLint;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
};
A1F2218C1E3FEF2800419B06 /* Run Swift Linter */ = {
A1F2218C1E3FEF2800419B06 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Swift Linter";
name = SwiftLint;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -491,15 +493,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -529,6 +537,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -544,15 +553,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -574,6 +589,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -599,7 +615,7 @@
PRODUCT_NAME = HandyUIKit;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -620,7 +636,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKit;
PRODUCT_NAME = HandyUIKit;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -633,7 +649,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -646,7 +662,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flinesoft.HandyUIKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -668,7 +684,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -691,7 +707,7 @@
PRODUCT_NAME = HandyUIKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -707,7 +723,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.flinesoft.HandyUIKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Debug;
Expand All @@ -722,7 +738,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.flinesoft.HandyUIKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading

0 comments on commit 8054e96

Please sign in to comment.