Skip to content

Commit

Permalink
Merge pull request #20 from tbaranes/feature/swiftlint_0_17_0
Browse files Browse the repository at this point in the history
Bump SwifLint 0.17.0 and Xcode 8.3
  • Loading branch information
Tom Baranes authored Mar 28, 2017
2 parents 5f9f73e + 57f1f75 commit c90a8e8
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ language: objective-c
osx_image: xcode8
notifications:
email: false
branches:
only:
- master
env:
global:
- LC_CTYPE=en_US.UTF-8
Expand Down Expand Up @@ -36,3 +39,6 @@ script:
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
fi

after_success:
- sleep 5 # Workaround for https://github.com/travis-ci/travis-ci/issues/4725
30 changes: 30 additions & 0 deletions FittableFontLabel Example/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
identifier_name:
min_length: 2
excluded:
- x

type_name:
excluded:
- T

line_length: 150
file_length: 500
number_separator:
minimum_length: 5

opt_in_rules:
- closure_spacing
- conditional_returns_on_newline
- empty_count
- explicit_init
- overridden_super_call
- redundant_nil_coalescing
- nimble_operator
- closure_end_indentation
- first_where
- attributes
- operator_usage_whitespace
- prohibited_super_call
- number_separator
- object_literal
- fatal_error_message
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = Recisio;
TargetAttributes = {
E2C3AF3D1C4FBFB300EB275B = {
Expand Down Expand Up @@ -263,8 +263,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -308,8 +310,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
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 = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
11 changes: 10 additions & 1 deletion FittableFontLabel/FittableFontLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = "Tom Baranes";
TargetAttributes = {
E2227AA11CCE80C5006C4289 = {
Expand Down Expand Up @@ -267,8 +267,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -316,8 +318,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -347,6 +351,7 @@
E2227AB71CCE80C5006C4289 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -365,6 +370,7 @@
E2227AB81CCE80C5006C4289 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand Down Expand Up @@ -420,8 +426,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -452,6 +460,7 @@
E251BE331CCE813100EA621A /* ReleaseTest */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
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 = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 2 additions & 3 deletions Source/UILabelExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public extension UILabel {
return self.font.pointSize
}


let constraintSize = numberOfLines == 1 ?
CGSize(width: CGFloat.greatestFiniteMagnitude, height: rectSize.height) :
CGSize(width: rectSize.width, height: CGFloat.greatestFiniteMagnitude)
Expand All @@ -72,7 +71,7 @@ private extension UILabel {

func currentAttributedStringAttributes() -> [String : Any] {
var newAttributes = [String: Any]()
attributedText?.enumerateAttributes(in: NSRange(0..<(text?.characters.count ?? 0)), options: .longestEffectiveRangeNotRequired, using: { attributes, range, stop in
attributedText?.enumerateAttributes(in: NSRange(0..<(text?.characters.count ?? 0)), options: .longestEffectiveRangeNotRequired, using: { attributes, _, _ in
newAttributes = attributes
})
return newAttributes
Expand All @@ -85,7 +84,7 @@ private extension UILabel {
private extension UILabel {

enum FontSizeState {
case Fit, TooBig, TooSmall
case fit, tooBig, tooSmall
}

func binarySearch(string: String, minSize: CGFloat, maxSize: CGFloat, size: CGSize, constraintSize: CGSize) -> CGFloat {
Expand Down

0 comments on commit c90a8e8

Please sign in to comment.