Skip to content

Commit ea0b78e

Browse files
Mark Pospeselmpospese
authored andcommitted
[CM-997] Add linter rules and fix warnings
1 parent f63a9b6 commit ea0b78e

File tree

12 files changed

+14
-16
lines changed

12 files changed

+14
-16
lines changed

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ opt_in_rules: # some rules are turned off by default, so you need to opt-in
99
- empty_count
1010
- first_where
1111
- force_unwrapping
12+
- implicit_return
13+
- missing_docs
1214
- multiline_arguments
1315
- multiline_arguments_brackets
1416
- multiline_function_chains

Sources/YComponentBrowser/CatalogFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public enum CatalogFactory {
4545
with categories: [Classification],
4646
navigationTitle: String? = nil
4747
) -> UIViewController {
48-
return ClassificationViewController(
48+
ClassificationViewController(
4949
datasource: ClassificationDataSource(
5050
navigationTitle: navigationTitle,
5151
classification: categories

Sources/YComponentBrowser/ClassificationScene/ClassificationDataSource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public final class ClassificationDataSource: NSObject, CatalogDataSource {
3434

3535
/// :nodoc:
3636
public func category(for indexPath: IndexPath) -> Classification {
37-
return categories[indexPath.row]
37+
categories[indexPath.row]
3838
}
3939

4040
/// :nodoc:
4141
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
42-
return categories.count
42+
categories.count
4343
}
4444

4545
/// :nodoc:

Sources/YComponentBrowser/ClassificationScene/ClassificationViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class ClassificationViewController<DataSource: CatalogDataSource>:
2121
}
2222

2323
/// :nodoc:
24-
public required init?(coder: NSCoder) { return nil }
24+
public required init?(coder: NSCoder) { nil }
2525

2626
/// :nodoc:
2727
public override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

Sources/YComponentBrowser/Models/Destinations/CatalogDetailDestination.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct CatalogDetailDestination<View: ContentView>: Destination {
1919

2020
/// Creates a tableview controller that displays the model data within the specified view
2121
public func getDestinationController() -> UIViewController {
22-
return CatalogFactory.createGenericDisplayViewController(
22+
CatalogFactory.createGenericDisplayViewController(
2323
viewType: View.self,
2424
models: models,
2525
navigationTitle: navigationTitle

Sources/YComponentBrowser/Models/Destinations/SubcategoryDetailDestination.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ public struct SubcategoryDetailDestination: Destination {
1919

2020
/// Creates a subcategory view controller
2121
public func getDestinationController() -> UIViewController {
22-
return CatalogFactory.createClassificationViewController(with: subcategories, navigationTitle: navigationTitle)
22+
CatalogFactory.createClassificationViewController(with: subcategories, navigationTitle: navigationTitle)
2323
}
2424
}

Sources/YComponentBrowser/Protocols/Identifiable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ public protocol Identifiable {
1515
/// Default implementation that returns the object type as the identifier
1616
public extension Identifiable {
1717
/// Unique identifier for the type of object
18-
static var identifier: String { return "\(self)" }
18+
static var identifier: String { "\(self)" }
1919
}

Sources/YComponentBrowser/UI Components/Generic Cells/GenericCollectionViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public final class GenericCollectionViewCell<View: ContentView>: UICollectionVie
3939
}
4040

4141
/// :nodoc:
42-
public required init?(coder: NSCoder) { return nil }
42+
public required init?(coder: NSCoder) { nil }
4343

4444
/// :nodoc:
4545
public override func prepareForReuse() {

Sources/YComponentBrowser/UI Components/Generic Cells/GenericTableViewCell.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public final class GenericTableViewCell<View: ContentView>: UITableViewCell, Ide
2121
}
2222

2323
/// :nodoc:
24-
public required init?(coder: NSCoder) {
25-
return nil
26-
}
24+
public required init?(coder: NSCoder) { nil }
2725

2826
/// :nodoc:
2927
public override func setHighlighted(_ highlighted: Bool, animated: Bool) {

Sources/YComponentBrowser/UI Components/Generic Controllers/GenericCollectionViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final public class GenericCollectionViewController<View: ContentView>: UICollect
3737
_ collectionView: UICollectionView,
3838
numberOfItemsInSection section: Int
3939
) -> Int {
40-
return models.count
40+
models.count
4141
}
4242

4343
/// :nodoc:

0 commit comments

Comments
 (0)