Update SwiftLint to version 0.52.x, fix new violations or disable them (#618)

This commit is contained in:
Danny Mösch 2023-06-25 19:21:45 +02:00 committed by GitHub
parent d9bd0f3014
commit ba1a81170b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 10 deletions

View file

@ -15,6 +15,7 @@ opt_in_rules:
disabled_rules: disabled_rules:
- anonymous_argument_in_multiline_closure - anonymous_argument_in_multiline_closure
- anyobject_protocol # Deprecated.
- balanced_xctest_lifecycle - balanced_xctest_lifecycle
- discouraged_none_name - discouraged_none_name
- discouraged_object_literal - discouraged_object_literal
@ -35,6 +36,7 @@ disabled_rules:
- function_body_length - function_body_length
- implicitly_unwrapped_optional - implicitly_unwrapped_optional
- indentation_width - indentation_width
- inert_defer # Deprecated.
- legacy_objc_type - legacy_objc_type
- line_length - line_length
- missing_docs - missing_docs
@ -49,10 +51,12 @@ disabled_rules:
- prohibited_super_call - prohibited_super_call
- required_deinit - required_deinit
- self_binding - self_binding
- sorted_enum_cases # Wait for an auto-fix.
- sorted_imports # Managed by SwiftFormat. - sorted_imports # Managed by SwiftFormat.
- type_body_length - type_body_length
- type_contents_order - type_contents_order
- unowned_variable_capture - unowned_variable_capture
- unused_capture_list # Deprecated.
- vertical_whitespace_between_cases # Additional whitespace not needed because of visible indentation. - vertical_whitespace_between_cases # Additional whitespace not needed because of visible indentation.
## Configuration for specific rules ## Configuration for specific rules
@ -73,3 +77,7 @@ trailing_closure:
only_single_muted_parameter: true only_single_muted_parameter: true
trailing_comma: trailing_comma:
mandatory_comma: true mandatory_comma: true
xct_specific_matcher:
matchers:
- two-argument-asserts

View file

@ -491,9 +491,8 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
override func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat { override func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if tableData[section].header != nil { if tableData[section].header != nil {
return 30 return 30
} else {
return UITableView.automaticDimension
} }
return UITableView.automaticDimension
} }
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {

View file

@ -209,14 +209,12 @@ class PasswordEditorTableViewController: UITableViewController {
if sectionHeaderTitles[section] != nil { if sectionHeaderTitles[section] != nil {
if UIDevice.current.userInterfaceIdiom == .phone { if UIDevice.current.userInterfaceIdiom == .phone {
return 30 return 30
} else { }
// Fix covered section header in macOS // Fix covered section header in macOS
return 36 return 36
} }
} else {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
}
override func tableView(_: UITableView, heightForFooterInSection _: Int) -> CGFloat { override func tableView(_: UITableView, heightForFooterInSection _: Int) -> CGFloat {
UITableView.automaticDimension UITableView.automaticDimension

View file

@ -59,7 +59,7 @@ class PasswordNavigationViewController: UIViewController {
let addPasswordButton = UIButton(type: .system) let addPasswordButton = UIButton(type: .system)
let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular)) let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
addPasswordButton.setImage(plusImage, for: .normal) 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 addPasswordUIBarButtonItem.customView = addPasswordButton
return addPasswordUIBarButtonItem return addPasswordUIBarButtonItem
}() }()

View file

@ -105,7 +105,8 @@ extension NSDictionary {
return host return host
} }
return value return value
} else if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String { }
if let value = self[NSExtensionJavaScriptPreprocessingResultsKey] as? String {
if let host = URL(string: value)?.host { if let host = URL(string: value)?.host {
return host return host
} }

View file

@ -1,6 +1,6 @@
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}" export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
SWIFTLINT_VERSION="0.51.*" SWIFTLINT_VERSION="0.52.*"
if [[ "${CI}" == "true" ]]; then if [[ "${CI}" == "true" ]]; then
echo "Running in a Continuous Integration environment. Linting is skipped." echo "Running in a Continuous Integration environment. Linting is skipped."