Skip to content

Commit 1dd6290

Browse files
Updating SwiftLint to 0.35.0
1 parent 0b905ad commit 1dd6290

18 files changed

+64
-48
lines changed

.swiftlint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ opt_in_rules:
99
- closure_end_indentation
1010
- closure_spacing
1111
- conditional_returns_on_newline
12+
- contains_over_filter_count
13+
- contains_over_filter_is_empty
1214
- contains_over_first_not_nil
1315
- convenience_type
16+
- empty_collection_literal
1417
- empty_count
1518
- empty_string
1619
- empty_xctest_method
@@ -20,11 +23,13 @@ opt_in_rules:
2023
- fatal_error_message
2124
- file_name
2225
- file_header
26+
- file_types_order
2327
- first_where
2428
- force_unwrapping
2529
- implicitly_unwrapped_optional
2630
- joined_default_parameter
2731
- last_where
32+
- legacy_multiple
2833
- let_var_whitespace
2934
- literal_expression_end_indentation
3035
- lower_acl_than_parent
@@ -51,6 +56,7 @@ opt_in_rules:
5156
- quick_discouraged_call
5257
- quick_discouraged_focused_test
5358
- quick_discouraged_pending_test
59+
- reduce_into
5460
- redundant_nil_coalescing
5561
- single_test_class
5662
- sorted_first_last
@@ -59,6 +65,7 @@ opt_in_rules:
5965
- trailing_closure
6066
- unavailable_function
6167
- unneeded_parentheses_in_closure_argument
68+
- unowned_variable_capture
6269
- untyped_error_in_catch
6370
- vertical_parameter_alignment_on_call
6471
- vertical_whitespace_between_cases
@@ -84,7 +91,7 @@ file_header:
8491
\/\/
8592
\/\/ The MIT License \(MIT\)
8693
\/\/
87-
\/\/ Copyright \(c\) 2015 - 2018 Fabrizio Brancati\.
94+
\/\/ Copyright \(c\) 2015 - 2019 Fabrizio Brancati\.
8895
\/\/
8996
\/\/ Permission is hereby granted, free of charge, to any person obtaining a copy
9097
\/\/ of this software and associated documentation files \(the "Software"\), to deal

BFKit-Swift.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
s.name = 'BFKit-Swift'
33
s.module_name = 'BFKit'
4-
s.version = '5.0.0'
4+
s.version = '6.0.0'
55
s.summary = 'BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.'
66
s.homepage = 'https://github.com/FabrizioBrancati/BFKit-Swift'
77
s.screenshots = 'https://github.fabriziobrancati.com/bfkit/resources/screenshot-swift.png'

BFKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@
10541054
CLANG_CXX_LIBRARY = "libc++";
10551055
CODE_SIGN_IDENTITY = "";
10561056
COMBINE_HIDPI_IMAGES = YES;
1057-
CURRENT_PROJECT_VERSION = 1;
1057+
CURRENT_PROJECT_VERSION = 6.0.0;
10581058
DEFINES_MODULE = YES;
10591059
DEVELOPMENT_TEAM = "";
10601060
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1083,7 +1083,7 @@
10831083
CLANG_CXX_LIBRARY = "libc++";
10841084
CODE_SIGN_IDENTITY = "";
10851085
COMBINE_HIDPI_IMAGES = YES;
1086-
CURRENT_PROJECT_VERSION = 1;
1086+
CURRENT_PROJECT_VERSION = 6.0.0;
10871087
DEFINES_MODULE = YES;
10881088
DEVELOPMENT_TEAM = "";
10891089
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1232,7 +1232,7 @@
12321232
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
12331233
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
12341234
COPY_PHASE_STRIP = NO;
1235-
CURRENT_PROJECT_VERSION = 5.0.0;
1235+
CURRENT_PROJECT_VERSION = 6.0.0;
12361236
DEBUG_INFORMATION_FORMAT = dwarf;
12371237
ENABLE_STRICT_OBJC_MSGSEND = YES;
12381238
ENABLE_TESTABILITY = YES;
@@ -1296,7 +1296,7 @@
12961296
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
12971297
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
12981298
COPY_PHASE_STRIP = NO;
1299-
CURRENT_PROJECT_VERSION = 5.0.0;
1299+
CURRENT_PROJECT_VERSION = 6.0.0;
13001300
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
13011301
ENABLE_NS_ASSERTIONS = NO;
13021302
ENABLE_STRICT_OBJC_MSGSEND = YES;

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ All notable changes to this project will be documented in this file.<br>
5959
- Removed support to UIWebView [#44](https://github.com/FabrizioBrancati/BFKit-Swift/pull/44)
6060
- Removed `isURLValid` on Linux
6161

62+
### Improved
63+
- Updated SwiftLint to 0.35.0
64+
6265
Thanks to [@Tripwire999](https://github.com/Tripwire999) for this release
6366

6467
---

Example/BFKitExample/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.0.0</string>
20+
<string>6.0.0</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>

Sources/BFKit/Apple/BFKit/BFButton.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ open class BFButton: UIButton {
4747
}
4848
} else {
4949
UIView.animate(
50-
withDuration: fadeDuration, animations: { [weak self] in
50+
withDuration: fadeDuration,
51+
animations: { [weak self] in
5152
self?.overlayImageView.alpha = 0
5253
}, completion: { [weak self] completed in
5354
if completed {

Sources/BFKit/Apple/BFKit/BFTextField.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ open class BFTextField: UITextField {
5050
NotificationCenter.default.addObserver(self, selector: #selector(BFTextField.textFieldDidChange(_:)), name: UITextField.textDidChangeNotification, object: self)
5151
}
5252

53-
/// Encodes added variables.
54-
///
55-
/// - Parameter aCoder: NSCoder.
56-
override open func encode(with aCoder: NSCoder) {
57-
super.encode(with: aCoder)
58-
59-
aCoder.encode(maxNumberOfCharacters, forKey: "MaxNumberOfCharacters")
60-
}
61-
6253
/// Override init with frame.
6354
///
6455
/// - Parameter frame: TextField frame.
@@ -69,6 +60,15 @@ open class BFTextField: UITextField {
6960
NotificationCenter.default.addObserver(self, selector: #selector(BFTextField.textFieldDidChange(_:)), name: UITextField.textDidChangeNotification, object: self)
7061
}
7162

63+
/// Encodes added variables.
64+
///
65+
/// - Parameter aCoder: NSCoder.
66+
override open func encode(with aCoder: NSCoder) {
67+
super.encode(with: aCoder)
68+
69+
aCoder.encode(maxNumberOfCharacters, forKey: "MaxNumberOfCharacters")
70+
}
71+
7272
@objc
7373
/// Text field did change function.
7474
///

Sources/BFKit/Apple/UIKit/UITableView+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public extension UITableView {
5656
/// - Returns: Returns the next index path.
5757
func nextIndexPath(row: Int, forSection section: Int) -> IndexPath? {
5858
let indexPath: [IndexPath] = indexPaths(section: section)
59-
guard indexPath != [] else {
59+
guard indexPath.isNotEmpty else {
6060
return nil
6161
}
6262

@@ -71,7 +71,7 @@ public extension UITableView {
7171
/// - Returns: Returns the previous index path.
7272
func previousIndexPath(row: Int, forSection section: Int) -> IndexPath? {
7373
let indexPath: [IndexPath] = indexPaths(section: section)
74-
guard indexPath != [] else {
74+
guard indexPath.isNotEmpty else {
7575
return nil
7676
}
7777

Sources/BFKit/Apple/UIKit/UIView+Extensions.swift

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,48 @@ public extension UIView {
3636
// MARK: - Variables
3737

3838
/// Direction of flip animation.
39-
///
40-
/// - top: Flip animation from top.
41-
/// - left: Flip animation from left.
42-
/// - right: Flip animation from right.
43-
/// - bottom: Flip animation from bottom.
4439
enum UIViewAnimationFlipDirection: String {
40+
/// Flip animation from top.
4541
case top = "fromTop"
42+
/// Flip animation from left.
4643
case left = "fromLeft"
44+
/// Flip animation from right.
4745
case right = "fromRight"
46+
/// Flip animation from bottom.
4847
case bottom = "fromBottom"
4948
}
5049

5150
/// Direction of the translation.
52-
///
53-
/// - leftToRight: Translation from left to right.
54-
/// - rightToLeft: Translation from right to left.
5551
enum UIViewAnimationTranslationDirection: Int {
52+
/// Translation from left to right.
5653
case leftToRight
54+
/// Translation from right to left.
5755
case rightToLeft
5856
}
5957

6058
/// Direction of the linear gradient.
61-
///
62-
/// - vertical: Linear gradient vertical.
63-
/// - horizontal: Linear gradient horizontal.
64-
/// - diagonalLeftToRightAndTopToDown: Linear gradient from left top to right down.
65-
/// - diagonalLeftToRightAndDownToTop: Linear gradient from left down to right top.
66-
/// - diagonalRightToLeftAndTopToDown: Linear gradient from right top to left down.
67-
/// - diagonalRightToLeftAndDownToTop: Linear gradient from right down to left top.
6859
enum UIViewGradientDirection {
60+
/// Linear gradient vertical.
6961
case vertical
62+
/// Linear gradient horizontal.
7063
case horizontal
64+
/// Linear gradient from left top to right down.
7165
case diagonalLeftTopToRightDown
66+
/// Linear gradient from left down to right top.
7267
case diagonalLeftDownToRightTop
68+
/// Linear gradient from right top to left down.
7369
case diagonalRightTopToLeftDown
70+
/// Linear gradient from right down to left top.
7471
case diagonalRightDownToLeftTop
72+
/// Custom gradient direction.
7573
case custom(startPoint: CGPoint, endPoint: CGPoint)
7674
}
7775

7876
/// Type of gradient.
79-
///
80-
/// - linear: Linear gradient.
81-
/// - radial: Radial gradient.
8277
enum UIViewGradientType {
78+
/// Linear gradient.
8379
case linear
80+
/// Radial gradient.
8481
case radial
8582
}
8683

@@ -498,12 +495,18 @@ public extension UIView {
498495
}
499496

500497
UIView.animate(
501-
withDuration: TimeInterval(duration / 2), delay: 1, options: UIView.AnimationOptions(), animations: {
498+
withDuration: TimeInterval(duration / 2),
499+
delay: 1,
500+
options: UIView.AnimationOptions(),
501+
animations: {
502502
self.center = CGPoint(x: endPosition, y: self.center.y)
503503
}, completion: { finished in
504504
if finished {
505505
UIView.animate(
506-
withDuration: TimeInterval(duration / 2), delay: 1, options: UIView.AnimationOptions(), animations: {
506+
withDuration: TimeInterval(duration / 2),
507+
delay: 1,
508+
options: UIView.AnimationOptions(),
509+
animations: {
507510
self.center = CGPoint(x: startPosition, y: self.center.y)
508511
}, completion: { finished in
509512
if finished {

Sources/BFKit/Apple/UIKit/UIViewController+Extensions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public extension UIViewController {
3939

4040
if let coordinator = transitionCoordinator {
4141
coordinator.animateAlongsideTransition(
42-
in: parent?.view, animation: { coordinatorContext in
42+
in: parent?.view,
43+
animation: { coordinatorContext in
4344
selectedIndexPaths.forEach {
4445
tableView.deselectRow(at: $0, animated: coordinatorContext.isAnimated)
4546
}

Sources/BFKit/Apple/UIKit/UIWindow+Extensions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ public extension UIWindow {
204204
case .ended, .cancelled:
205205
if let touchImageView = touchImages[touch.hash] {
206206
UIView.animate(
207-
withDuration: 0.2, animations: {
207+
withDuration: 0.2,
208+
animations: {
208209
touchImageView.alpha = 0.0
209210
touchImageView.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
210211
}, completion: { finished -> Void in

Sources/Info-iOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.0</string>
18+
<string>6.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/Info-macOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.0</string>
18+
<string>6.0.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

Sources/Info-watchOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.0</string>
18+
<string>6.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Tests/Info-iOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.0</string>
18+
<string>6.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Tests/Info-macOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.0</string>
18+
<string>6.0.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

install_swiftlint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -e
88

99
SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
10-
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.31.0/SwiftLint.pkg"
10+
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.35.0/SwiftLint.pkg"
1111

1212
wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL
1313

jazzy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Creates documentation using Jazzy.
44

5-
FRAMEWORK_VERSION=5.0.0
5+
FRAMEWORK_VERSION=6.0.0
66

77
jazzy \
88
--clean \

0 commit comments

Comments
 (0)