Skip to content

Commit ba1a811

Browse files
authored
Update SwiftLint to version 0.52.x, fix new violations or disable them (#618)
1 parent d9bd0f3 commit ba1a811

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

.swiftlint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ opt_in_rules:
1515

1616
disabled_rules:
1717
- anonymous_argument_in_multiline_closure
18+
- anyobject_protocol # Deprecated.
1819
- balanced_xctest_lifecycle
1920
- discouraged_none_name
2021
- discouraged_object_literal
@@ -35,6 +36,7 @@ disabled_rules:
3536
- function_body_length
3637
- implicitly_unwrapped_optional
3738
- indentation_width
39+
- inert_defer # Deprecated.
3840
- legacy_objc_type
3941
- line_length
4042
- missing_docs
@@ -49,10 +51,12 @@ disabled_rules:
4951
- prohibited_super_call
5052
- required_deinit
5153
- self_binding
54+
- sorted_enum_cases # Wait for an auto-fix.
5255
- sorted_imports # Managed by SwiftFormat.
5356
- type_body_length
5457
- type_contents_order
5558
- unowned_variable_capture
59+
- unused_capture_list # Deprecated.
5660
- vertical_whitespace_between_cases # Additional whitespace not needed because of visible indentation.
5761

5862
## Configuration for specific rules
@@ -73,3 +77,7 @@ trailing_closure:
7377
only_single_muted_parameter: true
7478
trailing_comma:
7579
mandatory_comma: true
80+
xct_specific_matcher:
81+
matchers:
82+
- two-argument-asserts
83+

pass/Controllers/PasswordDetailTableViewController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,8 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
491491
override func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
492492
if tableData[section].header != nil {
493493
return 30
494-
} else {
495-
return UITableView.automaticDimension
496494
}
495+
return UITableView.automaticDimension
497496
}
498497

499498
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {

pass/Controllers/PasswordEditorTableViewController.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ class PasswordEditorTableViewController: UITableViewController {
209209
if sectionHeaderTitles[section] != nil {
210210
if UIDevice.current.userInterfaceIdiom == .phone {
211211
return 30
212-
} else {
213-
// Fix covered section header in macOS
214-
return 36
215212
}
216-
} else {
217-
return UITableView.automaticDimension
213+
// Fix covered section header in macOS
214+
return 36
218215
}
216+
return UITableView.automaticDimension
219217
}
220218

221219
override func tableView(_: UITableView, heightForFooterInSection _: Int) -> CGFloat {

pass/Controllers/PasswordNavigationViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class PasswordNavigationViewController: UIViewController {
5959
let addPasswordButton = UIButton(type: .system)
6060
let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
6161
addPasswordButton.setImage(plusImage, for: .normal)
62-
addPasswordButton.addTarget(self, action: #selector(self.addPasswordAction), for: .touchDown)
62+
addPasswordButton.addTarget(self, action: #selector(addPasswordAction), for: .touchDown)
6363
addPasswordUIBarButtonItem.customView = addPasswordButton
6464
return addPasswordUIBarButtonItem
6565
}()

passExtension/Controllers/ExtensionViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ extension NSDictionary {
105105
return host
106106
}
107107
return value
108-
} else if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String {
108+
}
109+
if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String {
109110
if let host = URL(string: value)?.host {
110111
return host
111112
}

scripts/swiftlint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
22

3-
SWIFTLINT_VERSION="0.51.*"
3+
SWIFTLINT_VERSION="0.52.*"
44

55
if [[ "${CI}" == "true" ]]; then
66
echo "Running in a Continuous Integration environment. Linting is skipped."

0 commit comments

Comments
 (0)