diff --git a/.swiftlint.yml b/.swiftlint.yml index 3715ce1e6..2603ac3f1 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -21,6 +21,8 @@ disabled_rules: - force_try - cyclomatic_complexity - generic_type_name + - function_body_length + - type_body_length excluded: - Modules/Secrets/Sources/Secrets/SecretKey.swift diff --git a/Mac/ShareExtension/ShareViewController.swift b/Mac/ShareExtension/ShareViewController.swift index 30144f2e1..9301f78a3 100644 --- a/Mac/ShareExtension/ShareViewController.swift +++ b/Mac/ShareExtension/ShareViewController.swift @@ -23,7 +23,6 @@ class ShareViewController: NSViewController { return NSNib.Name("ShareViewController") } - // swiftlint:disable:next function_body_length override func loadView() { super.loadView() diff --git a/Shared/Widget/WidgetDataEncoder.swift b/Shared/Widget/WidgetDataEncoder.swift index 7260497b7..83dbf0da9 100644 --- a/Shared/Widget/WidgetDataEncoder.swift +++ b/Shared/Widget/WidgetDataEncoder.swift @@ -64,7 +64,6 @@ public final class WidgetDataEncoder { } } - // swiftlint:disable:next function_body_length private func encodeWidgetData(completion: @escaping (WidgetData?) -> Void) { let dispatchGroup = DispatchGroup() var groupError: Error? diff --git a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift index 19d7ce730..4c909cfa2 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift @@ -20,7 +20,6 @@ class MainFeedTableViewCell: VibrantTableViewCell { weak var delegate: MainFeedTableViewCellDelegate? override var accessibilityLabel: String? { - set {} get { if unreadCount > 0 { let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility") diff --git a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift index 00941427e..037d4fb0e 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift @@ -8,16 +8,15 @@ import UIKit -protocol MainFeedTableViewSectionHeaderDelegate { +protocol MainFeedTableViewSectionHeaderDelegate: AnyObject { func mainFeedTableViewSectionHeaderDisclosureDidToggle(_ sender: MainFeedTableViewSectionHeader) } class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView { - var delegate: MainFeedTableViewSectionHeaderDelegate? + weak var delegate: MainFeedTableViewSectionHeaderDelegate? override var accessibilityLabel: String? { - set {} get { if unreadCount > 0 { let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility") @@ -29,7 +28,6 @@ class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView { } private var expandedStateMessage: String { - set {} get { if disclosureExpanded { return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility") diff --git a/iOS/MainTimeline/TimelineViewController.swift b/iOS/MainTimeline/TimelineViewController.swift index d4e08b66c..017dc2e7c 100644 --- a/iOS/MainTimeline/TimelineViewController.swift +++ b/iOS/MainTimeline/TimelineViewController.swift @@ -581,7 +581,16 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner { status: status ) - let prototypeCellData = MainTimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false, numberOfLines: numberOfTextLines, iconSize: iconSize) + let prototypeCellData = MainTimelineCellData( + article: prototypeArticle, + showFeedName: .feed, + feedName: "Prototype Feed Name", + byline: nil, + iconImage: nil, + showIcon: false, + numberOfLines: numberOfTextLines, + iconSize: iconSize + ) if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory { let layout = MainTimelineAccessibilityCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index a97c32423..973c2f5c6 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -156,7 +156,6 @@ class SettingsViewController: UITableViewController { return cell } - // swiftlint:disable:next function_body_length override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch indexPath.section { diff --git a/iOS/ShareExtension/ShareViewController.swift b/iOS/ShareExtension/ShareViewController.swift index 29d3c3dbd..425c3748e 100644 --- a/iOS/ShareExtension/ShareViewController.swift +++ b/iOS/ShareExtension/ShareViewController.swift @@ -22,7 +22,6 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont private var selectedContainer: ExtensionContainer? private var folderItem: SLComposeSheetConfigurationItem! - // swiftlint:disable:next function_body_length override func viewDidLoad() { extensionContainers = ExtensionContainersFile.read()