Fix linting
This commit is contained in:
parent
94b4c9278c
commit
5e453238c1
|
@ -23,11 +23,13 @@ only_rules:
|
||||||
- discarded_notification_center_observer
|
- discarded_notification_center_observer
|
||||||
- discouraged_assert
|
- discouraged_assert
|
||||||
- discouraged_direct_init
|
- discouraged_direct_init
|
||||||
|
- discouraged_none_name
|
||||||
- discouraged_object_literal
|
- discouraged_object_literal
|
||||||
- discouraged_optional_boolean
|
- discouraged_optional_boolean
|
||||||
- discouraged_optional_collection
|
- discouraged_optional_collection
|
||||||
- duplicate_enum_cases
|
- duplicate_enum_cases
|
||||||
- duplicate_imports
|
- duplicate_imports
|
||||||
|
- duplicated_key_in_dictionary_literal
|
||||||
- dynamic_inline
|
- dynamic_inline
|
||||||
- empty_collection_literal
|
- empty_collection_literal
|
||||||
- empty_count
|
- empty_count
|
||||||
|
@ -136,7 +138,6 @@ only_rules:
|
||||||
- vertical_whitespace_closing_braces
|
- vertical_whitespace_closing_braces
|
||||||
- vertical_whitespace_opening_braces
|
- vertical_whitespace_opening_braces
|
||||||
- void_return
|
- void_return
|
||||||
- weak_delegate
|
|
||||||
- xct_specific_matcher
|
- xct_specific_matcher
|
||||||
- xctfail_message
|
- xctfail_message
|
||||||
- yoda_condition
|
- yoda_condition
|
||||||
|
@ -159,12 +160,14 @@ identifier_name:
|
||||||
excluded:
|
excluded:
|
||||||
- 'x'
|
- 'x'
|
||||||
- 'y'
|
- 'y'
|
||||||
|
- 'z'
|
||||||
- 'a'
|
- 'a'
|
||||||
- 'b'
|
- 'b'
|
||||||
- 'x1'
|
- 'x1'
|
||||||
- 'x2'
|
- 'x2'
|
||||||
- 'y1'
|
- 'y1'
|
||||||
- 'y2'
|
- 'y2'
|
||||||
|
- 'z2'
|
||||||
deployment_target:
|
deployment_target:
|
||||||
macOS_deployment_target: '10.11'
|
macOS_deployment_target: '10.11'
|
||||||
custom_rules:
|
custom_rules:
|
||||||
|
@ -180,12 +183,19 @@ custom_rules:
|
||||||
regex: '\bNSPoint\b'
|
regex: '\bNSPoint\b'
|
||||||
match_kinds: typeidentifier
|
match_kinds: typeidentifier
|
||||||
message: 'Use CGPoint instead of NSPoint'
|
message: 'Use CGPoint instead of NSPoint'
|
||||||
|
no_cgfloat:
|
||||||
|
regex: '\bCGFloat\b'
|
||||||
|
match_kinds: typeidentifier
|
||||||
|
message: 'Use Double instead of CGFloat'
|
||||||
|
no_cgfloat2:
|
||||||
|
regex: '\bCGFloat\('
|
||||||
|
message: 'Use Double instead of CGFloat'
|
||||||
swiftui_state_private:
|
swiftui_state_private:
|
||||||
regex: '@(State|StateObject|ObservedObject|EnvironmentObject)\s+var'
|
regex: '@(State|StateObject|ObservedObject|EnvironmentObject)\s+var'
|
||||||
message: "SwiftUI @State/@StateObject/@ObservedObject/@EnvironmentObject properties should be private"
|
message: 'SwiftUI @State/@StateObject/@ObservedObject/@EnvironmentObject properties should be private'
|
||||||
swiftui_environment_private:
|
swiftui_environment_private:
|
||||||
regex: '@Environment\(\\\.\w+\)\s+var'
|
regex: '@Environment\(\\\.\w+\)\s+var'
|
||||||
message: "SwiftUI @Environment properties should be private"
|
message: 'SwiftUI @Environment properties should be private'
|
||||||
final_class:
|
final_class:
|
||||||
regex: '^class [a-zA-Z\d]+[^{]+\{'
|
regex: '^class [a-zA-Z\d]+[^{]+\{'
|
||||||
message: "Classes should be marked as final whenever possible. If you actually need it to be subclassable, just add `// swiftlint:disable:next final_class`."
|
message: 'Classes should be marked as final whenever possible. If you actually need it to be subclassable, just add `// swiftlint:disable:next final_class`.'
|
||||||
|
|
|
@ -33,6 +33,7 @@ final class CallbackMenuItem: NSMenuItem {
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init(coder decoder: NSCoder) {
|
required init(coder decoder: NSCoder) {
|
||||||
|
// swiftlint:disable:next fatal_error_message
|
||||||
fatalError()
|
fatalError()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ let package = Package(
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
|
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
|
|
|
@ -31,6 +31,7 @@ enum CarbonKeyboardShortcuts {
|
||||||
|
|
||||||
// `SSKS` is just short for `Sindre Sorhus Keyboard Shortcuts`.
|
// `SSKS` is just short for `Sindre Sorhus Keyboard Shortcuts`.
|
||||||
// Using an integer now that `UTGetOSTypeFromString("SSKS" as CFString)` is deprecated.
|
// Using an integer now that `UTGetOSTypeFromString("SSKS" as CFString)` is deprecated.
|
||||||
|
// swiftlint:disable:next number_separator
|
||||||
private static let hotKeySignature: UInt32 = 1397967699 // OSType => "SSKS"
|
private static let hotKeySignature: UInt32 = 1397967699 // OSType => "SSKS"
|
||||||
|
|
||||||
private static var hotKeyId = 0
|
private static var hotKeyId = 0
|
||||||
|
|
Loading…
Reference in New Issue