Skip to content

Commit 9cd1939

Browse files
authored
Swift format updates (#39)
Updates to match latest swift-format configuration in swift-mmio.
1 parent 4dd1df4 commit 9cd1939

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.swift-format

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"respectsExistingLineBreaks" : true,
2424
"rules" : {
2525
"AllPublicDeclarationsHaveDocumentation" : false,
26+
"AlwaysUseLiteralForEmptyCollectionInit" : true,
2627
"AlwaysUseLowerCamelCase" : true,
2728
"AmbiguousTrailingClosureOverload" : false,
28-
"BeginDocumentationCommentWithOneLineSummary" : false,
29+
"BeginDocumentationCommentWithOneLineSummary" : true,
2930
"DoNotUseSemicolons" : true,
3031
"DontRepeatTypeInStaticProperties" : true,
3132
"FileScopedDeclarationPrivacy" : true,
@@ -37,7 +38,7 @@
3738
"NeverUseImplicitlyUnwrappedOptionals" : true,
3839
"NoAccessLevelOnExtensionDeclaration" : true,
3940
"NoAssignmentInExpressions" : true,
40-
"NoBlockComments" : false,
41+
"NoBlockComments" : true,
4142
"NoCasesWithOnlyFallthrough" : true,
4243
"NoEmptyTrailingClosureParentheses" : true,
4344
"NoLabelsInCasePatterns" : true,
@@ -53,7 +54,8 @@
5354
"ReplaceForEachWithForLoop" : true,
5455
"ReturnVoidInsteadOfEmptyTuple" : true,
5556
"TypeNamesShouldBeCapitalized" : true,
56-
"UseEarlyExits" : true,
57+
"UseEarlyExits" : false,
58+
"UseExplicitNilCheckInConditions" : true,
5759
"UseLetInEveryBoundCaseVariable" : true,
5860
"UseShorthandTypeNames" : true,
5961
"UseSingleLinePropertyGetter" : true,

smart-light/Matter/Matter.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ extension Matter {
8686
case unknown(UInt32)
8787

8888
init?(cluster: Cluster, attribute: UInt32) {
89-
if let _ = cluster.as(OnOff.self) {
89+
if cluster.as(OnOff.self) != nil {
9090
switch attribute {
9191
case OnOff.AttributeID<OnOff.OnOffState>.state.rawValue: self = .onOff
9292
default: return nil
9393
}
94-
} else if let _ = cluster.as(LevelControl.self) {
94+
} else if cluster.as(LevelControl.self) != nil {
9595
switch attribute {
9696
case LevelControl.AttributeID<LevelControl.CurrentLevel>.currentLevel
9797
.rawValue:
9898
self = .levelControl
9999
default: return nil
100100
}
101-
} else if let _ = cluster.as(ColorControl.self) {
101+
} else if cluster.as(ColorControl.self) != nil {
102102
switch attribute {
103103
case ColorControl.AttributeID<ColorControl.CurrentHue>.currentHue
104104
.rawValue:

0 commit comments

Comments
 (0)