Enable SwiftLint rule 'convenience_type' and fix all violations
This commit is contained in:
parent
7d79314bae
commit
2e6cf69b03
5 changed files with 7 additions and 7 deletions
|
|
@ -25,7 +25,7 @@ whitelist_rules:
|
||||||
- contains_over_filter_is_empty
|
- contains_over_filter_is_empty
|
||||||
- contains_over_first_not_nil
|
- contains_over_first_not_nil
|
||||||
- control_statement
|
- control_statement
|
||||||
# - convenience_type
|
- convenience_type
|
||||||
- custom_rules
|
- custom_rules
|
||||||
# - cyclomatic_complexity
|
# - cyclomatic_complexity
|
||||||
- deployment_target
|
- deployment_target
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
//
|
//
|
||||||
// This file contains constants from https://github.com/agilebits/onepassword-app-extension/
|
// This file contains constants from https://github.com/agilebits/onepassword-app-extension/
|
||||||
|
|
||||||
class OnePasswordExtensionActions {
|
enum OnePasswordExtensionActions {
|
||||||
static let findLogin = "org.appextension.find-login-action"
|
static let findLogin = "org.appextension.find-login-action"
|
||||||
static let saveLogin = "org.appextension.save-login-action"
|
static let saveLogin = "org.appextension.save-login-action"
|
||||||
static let changePassword = "org.appextension.change-password-action"
|
static let changePassword = "org.appextension.change-password-action"
|
||||||
|
|
@ -15,7 +15,7 @@ class OnePasswordExtensionActions {
|
||||||
static let fillBrowser = "org.appextension.fill-browser-action"
|
static let fillBrowser = "org.appextension.fill-browser-action"
|
||||||
}
|
}
|
||||||
|
|
||||||
class OnePasswordExtensionKey {
|
enum OnePasswordExtensionKey {
|
||||||
// Login Dictionary keys - Used to get or set the properties of a 1Password Login
|
// Login Dictionary keys - Used to get or set the properties of a 1Password Login
|
||||||
static let URLStringKey = "url_string"
|
static let URLStringKey = "url_string"
|
||||||
static let usernameKey = "username"
|
static let usernameKey = "username"
|
||||||
|
|
@ -38,7 +38,7 @@ class OnePasswordExtensionKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Errors codes
|
// Errors codes
|
||||||
class OnePasswordExtensionError {
|
enum OnePasswordExtensionError {
|
||||||
static let errorDomain = "OnePasswordExtension"
|
static let errorDomain = "OnePasswordExtension"
|
||||||
static let errorCodeCancelledByUser = 0
|
static let errorCodeCancelledByUser = 0
|
||||||
static let errorCodeAPINotAvailable = 1
|
static let errorCodeAPINotAvailable = 1
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
// Copyright © 2019 Bob Sun. All rights reserved.
|
// Copyright © 2019 Bob Sun. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
public struct Colors {
|
public enum Colors {
|
||||||
public static let label: UIColor = {
|
public static let label: UIColor = {
|
||||||
if #available(iOS 13.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
return .label
|
return .label
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
// Copyright © 2017 Bob Sun. All rights reserved.
|
// Copyright © 2017 Bob Sun. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
public class Utils {
|
public enum Utils {
|
||||||
public static func copyToPasteboard(textToCopy: String?) {
|
public static func copyToPasteboard(textToCopy: String?) {
|
||||||
guard textToCopy != nil else {
|
guard textToCopy != nil else {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
// Copyright © 2018 Bob Sun. All rights reserved.
|
// Copyright © 2018 Bob Sun. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
public struct Constants {
|
public enum Constants {
|
||||||
static let OTP_SECRET = "otp_secret"
|
static let OTP_SECRET = "otp_secret"
|
||||||
static let OTP_TYPE = "otp_type"
|
static let OTP_TYPE = "otp_type"
|
||||||
static let OTP_ALGORITHM = "otp_algorithm"
|
static let OTP_ALGORITHM = "otp_algorithm"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue