Skip to content

Commit 2df94f5

Browse files
author
Luc Dion
committed
Fix swiftlint + improve fastlane
1 parent 4d5dafe commit 2df94f5

16 files changed

+78
-77
lines changed

.swiftlint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ opt_in_rules: # some rules are only opt-in
33
- closure_spacing
44
- explicit_init
55
- nimble_operator
6-
- number_separator
76
- operator_usage_whitespace
87
- overridden_super_call
98
- private_outlet

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ osx_image: xcode9
44
env:
55
matrix:
66
- SCHEME=PinLayout SDK=iphonesimulator11.0
7-
- SCHEME=PinLayout SDK=iphonesimulator10.3
8-
- SCHEME=PinLayoutSample SDK=iphonesimulator11.0
9-
- SCHEME=PinLayoutTVOS SDK=appletvsimulator11.0
7+
#- SCHEME=PinLayout SDK=iphonesimulator10.3
8+
#- SCHEME=PinLayoutSample SDK=iphonesimulator11.0
9+
#- SCHEME=PinLayoutTVOS SDK=appletvsimulator11.0
1010

1111
before_install:
1212
# - brew outdated xctool || brew upgrade xctool;
@@ -22,13 +22,13 @@ script:
2222
bundle exec fastlane travis
2323
fi
2424
25-
if [[ $SCHEME = "PinLayoutSample" ]]; then
26-
set -o pipefail && xcodebuild -workspace PinLayout.xcworkspace -scheme "$SCHEME" -sdk $SDK -destination 'platform=iOS Simulator,name=iPhone 6' build | xcpretty -f `xcpretty-travis-formatter`
27-
fi
25+
#if [[ $SCHEME = "PinLayoutSample" ]]; then
26+
# set -o pipefail && xcodebuild -workspace PinLayout.xcworkspace -scheme "$SCHEME" -sdk $SDK -destination 'platform=iOS Simulator,name=iPhone 6' build | xcpretty -f `xcpretty-travis-formatter`
27+
#fi
2828
29-
if [[ $SCHEME = "PinLayoutTVOS" ]]; then
30-
set -o pipefail && xcodebuild -workspace PinLayout.xcworkspace -scheme "$SCHEME" -sdk $SDK -destination 'platform=tvOS Simulator,name=Apple TV 1080p' build | xcpretty -f `xcpretty-travis-formatter`
31-
fi
29+
#if [[ $SCHEME = "PinLayoutTVOS" ]]; then
30+
# set -o pipefail && xcodebuild -workspace PinLayout.xcworkspace -scheme "$SCHEME" -sdk $SDK -destination 'platform=tvOS Simulator,name=Apple TV 1080p' build | xcpretty -f `xcpretty-travis-formatter`
31+
#fi
3232
3333
after_success:
3434
- |

Gemfile.lock

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
CFPropertyList (2.3.5)
5-
activesupport (4.2.9)
5+
activesupport (4.2.10)
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
@@ -41,15 +41,16 @@ GEM
4141
nap
4242
cocoapods-search (1.0.0)
4343
cocoapods-stats (1.0.0)
44-
cocoapods-trunk (1.2.0)
44+
cocoapods-trunk (1.3.0)
4545
nap (>= 0.8, < 2.0)
46-
netrc (= 0.7.8)
46+
netrc (~> 0.11)
4747
cocoapods-try (1.1.0)
4848
colored (1.2)
4949
colored2 (3.1.2)
5050
colorize (0.8.1)
5151
commander-fastlane (4.4.5)
5252
highline (~> 1.7.2)
53+
concurrent-ruby (1.0.5)
5354
declarative (0.0.10)
5455
declarative-option (0.1.0)
5556
domain_name (0.5.20170404)
@@ -121,19 +122,16 @@ GEM
121122
http-cookie (1.0.3)
122123
domain_name (~> 0.5)
123124
httpclient (2.8.3)
124-
i18n (0.8.6)
125-
jazzy (0.8.3)
126-
cocoapods (~> 1.0)
125+
i18n (0.9.0)
126+
concurrent-ruby (~> 1.0)
127+
jazzy (0.0.14)
128+
activesupport (~> 4.1)
127129
mustache (~> 0.99)
128-
open4
130+
nokogiri (~> 1.6)
129131
redcarpet (~> 3.2)
130-
rouge (~> 1.5)
131132
sass (~> 3.4)
132-
sqlite3 (~> 1.3)
133-
xcinvoke (~> 0.3.0)
134133
json (2.1.0)
135134
jwt (2.1.0)
136-
liferaft (0.0.6)
137135
little-plugger (1.1.4)
138136
logging (2.2.2)
139137
little-plugger (~> 1.1)
@@ -143,6 +141,7 @@ GEM
143141
mime-types-data (~> 3.2015)
144142
mime-types-data (3.2016.0521)
145143
mini_magick (4.5.1)
144+
mini_portile2 (2.3.0)
146145
minitest (5.10.3)
147146
molinillo (0.5.7)
148147
multi_json (1.12.2)
@@ -151,8 +150,9 @@ GEM
151150
mustache (0.99.8)
152151
nanaimo (0.2.3)
153152
nap (1.1.0)
154-
netrc (0.7.8)
155-
open4 (1.3.4)
153+
netrc (0.11.0)
154+
nokogiri (1.8.1)
155+
mini_portile2 (~> 2.3.0)
156156
os (0.9.6)
157157
plist (3.3.0)
158158
public_suffix (2.0.5)
@@ -165,10 +165,10 @@ GEM
165165
declarative-option (< 0.2.0)
166166
uber (< 0.2.0)
167167
retriable (3.1.1)
168-
rouge (1.11.1)
168+
rouge (2.0.7)
169169
ruby-macho (1.1.0)
170170
rubyzip (1.2.1)
171-
sass (3.5.1)
171+
sass (3.5.2)
172172
sass-listen (~> 4.0.0)
173173
sass-listen (4.0.0)
174174
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -180,7 +180,6 @@ GEM
180180
jwt (>= 1.5, < 3.0)
181181
multi_json (~> 1.10)
182182
slack-notifier (1.5.1)
183-
sqlite3 (1.3.13)
184183
synx (0.2.1)
185184
clamp (~> 0.6)
186185
colorize (~> 0.7)
@@ -198,16 +197,14 @@ GEM
198197
unf_ext (0.0.7.4)
199198
unicode-display_width (1.3.0)
200199
word_wrap (1.0.0)
201-
xcinvoke (0.3.0)
202-
liferaft (~> 0.0.6)
203200
xcodeproj (1.5.3)
204201
CFPropertyList (~> 2.3.3)
205202
claide (>= 1.0.2, < 2.0)
206203
colored2 (~> 3.1)
207204
nanaimo (~> 0.2.3)
208-
xcpretty (0.2.6)
209-
rouge (~> 1.8)
210-
xcpretty-travis-formatter (0.0.4)
205+
xcpretty (0.2.8)
206+
rouge (~> 2.0.7)
207+
xcpretty-travis-formatter (1.0.0)
211208
xcpretty (~> 0.2, >= 0.0.7)
212209

213210
PLATFORMS

PinLayout.xcodeproj/xcshareddata/xcschemes/PinLayout.xcscheme

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<BuildActionEntry
1010
buildForTesting = "YES"
1111
buildForRunning = "YES"
12-
buildForProfiling = "YES"
13-
buildForArchiving = "YES"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"
@@ -80,15 +82,6 @@
8082
savedToolIdentifier = ""
8183
useCustomWorkingDirectory = "NO"
8284
debugDocumentVersioning = "YES">
83-
<MacroExpansion>
84-
<BuildableReference
85-
BuildableIdentifier = "primary"
86-
BlueprintIdentifier = "249EFE791E64FB4C00165E39"
87-
BuildableName = "PinLayout.framework"
88-
BlueprintName = "PinLayout"
89-
ReferencedContainer = "container:PinLayout.xcodeproj">
90-
</BuildableReference>
91-
</MacroExpansion>
9285
</ProfileAction>
9386
<AnalyzeAction
9487
buildConfiguration = "Debug">

Sources/PinLayoutGlobals.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ public class PinLayoutGlobals {
4040
}
4141

4242
public let Pin = PinLayoutGlobals()
43-

Sources/PinLayoutImpl+Coordinates.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension PinLayoutImpl {
5353
}
5454

5555
internal func setLeft(_ value: CGFloat, _ context: Context) {
56-
if let _right = _right, let width = width {
56+
if let _right = _right, let width = width {
5757
warnConflict(context, ["right": _right, "width": width])
5858
} else if let _hCenter = _hCenter {
5959
warnConflict(context, ["Horizontal Center": _hCenter])
@@ -94,7 +94,7 @@ extension PinLayoutImpl {
9494
}
9595

9696
internal func setRight(_ value: CGFloat, _ context: Context) {
97-
if let _left = _left, let width = width {
97+
if let _left = _left, let width = width {
9898
warnConflict(context, ["left": _left, "width": width])
9999
} else if let _hCenter = _hCenter {
100100
warnConflict(context, ["Horizontal Center": _hCenter])
@@ -109,7 +109,6 @@ extension PinLayoutImpl {
109109
}
110110
}
111111

112-
// TODO: Delete this function?
113112
internal func setEnd(_ value: CGFloat, _ context: Context) {
114113
if isLTR() {
115114
setRight(value, context)
@@ -291,7 +290,7 @@ extension PinLayoutImpl {
291290

292291
internal func validateWidth(_ width: CGFloat, context: Context) -> Bool {
293292
if width < 0 {
294-
warnWontBeApplied("the width (\(width)) must be greater than or equal to zero.", context);
293+
warnWontBeApplied("the width (\(width)) must be greater than or equal to zero.", context)
295294
return false
296295
} else {
297296
return true
@@ -308,7 +307,7 @@ extension PinLayoutImpl {
308307

309308
internal func validateHeight(_ height: CGFloat, context: Context) -> Bool {
310309
if height < 0 {
311-
warnWontBeApplied("the height (\(height)) must be greater than or equal to zero.", context);
310+
warnWontBeApplied("the height (\(height)) must be greater than or equal to zero.", context)
312311
return false
313312
} else {
314313
return true

Sources/PinLayoutImpl.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PinLayoutImpl: PinLayout {
5656
internal var justify: HorizontalAlign?
5757
internal var align: VerticalAlign?
5858

59-
internal var _marginTop: CGFloat { return marginTop ?? 0 }
59+
internal var _marginTop: CGFloat { return marginTop ?? 0 }
6060
internal var _marginLeft: CGFloat { return marginLeft ?? 0 }
6161
internal var _marginBottom: CGFloat { return marginBottom ?? 0 }
6262
internal var _marginRight: CGFloat { return marginRight ?? 0 }
@@ -300,7 +300,6 @@ class PinLayoutImpl: PinLayout {
300300
}
301301
return self
302302
}
303-
304303

305304
//
306305
// topLeft, topCenter, topRight,
@@ -694,12 +693,12 @@ class PinLayoutImpl: PinLayout {
694693

695694
@discardableResult
696695
func aspectRatio(_ ratio: CGFloat) -> PinLayout {
697-
return setAspectRatio(ratio, context: { "aspectRatio(\(ratio))"})
696+
return setAspectRatio(ratio, context: { "aspectRatio(\(ratio))" })
698697
}
699698

700699
@discardableResult
701700
func aspectRatio(of view: UIView) -> PinLayout {
702-
return setAspectRatio(view.frame.width / view.frame.height, context: { "aspectRatio(of: \(viewDescription(view)))"})
701+
return setAspectRatio(view.frame.width / view.frame.height, context: { "aspectRatio(of: \(viewDescription(view)))" })
703702
}
704703

705704
@discardableResult
@@ -868,7 +867,7 @@ extension PinLayoutImpl {
868867
if shouldSizeToFit {
869868
warnConflict(context, ["fitSize": shouldSizeToFit])
870869
} else if ratio <= 0 {
871-
warnWontBeApplied("the aspectRatio (\(ratio)) must be greater than zero.", context);
870+
warnWontBeApplied("the aspectRatio (\(ratio)) must be greater than zero.", context)
872871
} else {
873872
_aspectRatio = ratio
874873
}
@@ -998,7 +997,7 @@ extension PinLayoutImpl {
998997
return warn("pinEdges() won't be applied, top, left, bottom and right coordinates are already set.")
999998
}
1000999

1001-
if let width = applyMinMax(toWidth: width), _left == nil || _right == nil {
1000+
if let width = applyMinMax(toWidth: width), _left == nil || _right == nil {
10021001
if let left = _left {
10031002
// convert the width into a right
10041003
assert(self._right == nil)
@@ -1047,7 +1046,7 @@ extension PinLayoutImpl {
10471046
var width = computeWidth()
10481047
var height = computeHeight()
10491048

1050-
if (width != nil || height != nil) {
1049+
if width != nil || height != nil {
10511050
if shouldSizeToFit {
10521051
// Apply min/max width/height before calling sizeThatFits() ... and reapply them after.
10531052
width = applyMinMax(toWidth: width)
@@ -1126,7 +1125,7 @@ extension PinLayoutImpl {
11261125
}
11271126

11281127
// Handle maxWidth
1129-
if let maxWidth = maxWidth, maxWidth < (result ?? CGFloat.greatestFiniteMagnitude) {
1128+
if let maxWidth = maxWidth, maxWidth < (result ?? CGFloat.greatestFiniteMagnitude) {
11301129
result = maxWidth
11311130
}
11321131

@@ -1192,7 +1191,7 @@ extension PinLayoutImpl {
11921191
}
11931192

11941193
// Handle maxHeight
1195-
if let maxHeight = maxHeight, maxHeight < (result ?? CGFloat.greatestFiniteMagnitude) {
1194+
if let maxHeight = maxHeight, maxHeight < (result ?? CGFloat.greatestFiniteMagnitude) {
11961195
result = maxHeight
11971196
}
11981197

Tests/AccurencyTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import PinLayout
2323

2424
@testable import PinLayout
2525

26-
2726
class AccurencyTests: QuickSpec {
2827
var viewController: UIViewController!
2928
var rootView: UIView!

Tests/AdjustSizeSpec.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ class AdjustSizeSpec: QuickSpec {
284284
}
285285
}
286286

287-
288287
describe("the result of the fitSize() method when pinning right edge + width") {
289288
it("should adjust the size with fitSize() and distribute extra width") {
290289
aView.pin.right(100).width(200).fitSize()
@@ -479,7 +478,6 @@ class AdjustSizeSpec: QuickSpec {
479478
expect(aView.frame).to(equal(CGRect(x: 35.0, y: 311.0, width: 180.0, height: 9.0)))
480479
}
481480

482-
483481
it("should adjust the size with fitSize()") {
484482
aView.pin.top(20).bottom(80).marginTop(10).marginBottom(10).fitSize().align(.center)
485483
expect(aView.frame).to(equal(CGRect(x: 140.0, y: 30.0, width: 6.0, height: 280.0)))

Tests/JustifyAlignSpec.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ class JustifyAlignSpec: QuickSpec {
183183
}
184184
}
185185

186-
187186
//
188187
// align + height
189188
//

0 commit comments

Comments
 (0)