Skip to content

Commit

Permalink
Update SwiftLint to version 0.52.x, fix new violations or disable them (
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored Jun 25, 2023
1 parent d9bd0f3 commit ba1a811
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ opt_in_rules:

disabled_rules:
- anonymous_argument_in_multiline_closure
- anyobject_protocol # Deprecated.
- balanced_xctest_lifecycle
- discouraged_none_name
- discouraged_object_literal
Expand All @@ -35,6 +36,7 @@ disabled_rules:
- function_body_length
- implicitly_unwrapped_optional
- indentation_width
- inert_defer # Deprecated.
- legacy_objc_type
- line_length
- missing_docs
Expand All @@ -49,10 +51,12 @@ disabled_rules:
- prohibited_super_call
- required_deinit
- self_binding
- sorted_enum_cases # Wait for an auto-fix.
- sorted_imports # Managed by SwiftFormat.
- type_body_length
- type_contents_order
- unowned_variable_capture
- unused_capture_list # Deprecated.
- vertical_whitespace_between_cases # Additional whitespace not needed because of visible indentation.

## Configuration for specific rules
Expand All @@ -73,3 +77,7 @@ trailing_closure:
only_single_muted_parameter: true
trailing_comma:
mandatory_comma: true
xct_specific_matcher:
matchers:
- two-argument-asserts

3 changes: 1 addition & 2 deletions pass/Controllers/PasswordDetailTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,8 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
override func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if tableData[section].header != nil {
return 30
} else {
return UITableView.automaticDimension
}
return UITableView.automaticDimension
}

override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
Expand Down
8 changes: 3 additions & 5 deletions pass/Controllers/PasswordEditorTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,11 @@ class PasswordEditorTableViewController: UITableViewController {
if sectionHeaderTitles[section] != nil {
if UIDevice.current.userInterfaceIdiom == .phone {
return 30
} else {
// Fix covered section header in macOS
return 36
}
} else {
return UITableView.automaticDimension
// Fix covered section header in macOS
return 36
}
return UITableView.automaticDimension
}

override func tableView(_: UITableView, heightForFooterInSection _: Int) -> CGFloat {
Expand Down
2 changes: 1 addition & 1 deletion pass/Controllers/PasswordNavigationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PasswordNavigationViewController: UIViewController {
let addPasswordButton = UIButton(type: .system)
let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
addPasswordButton.setImage(plusImage, for: .normal)
addPasswordButton.addTarget(self, action: #selector(self.addPasswordAction), for: .touchDown)
addPasswordButton.addTarget(self, action: #selector(addPasswordAction), for: .touchDown)
addPasswordUIBarButtonItem.customView = addPasswordButton
return addPasswordUIBarButtonItem
}()
Expand Down
3 changes: 2 additions & 1 deletion passExtension/Controllers/ExtensionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ extension NSDictionary {
return host
}
return value
} else if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String {
}
if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String {
if let host = URL(string: value)?.host {
return host
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/swiftlint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"

SWIFTLINT_VERSION="0.51.*"
SWIFTLINT_VERSION="0.52.*"

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

0 comments on commit ba1a811

Please sign in to comment.