Skip to content

Commit d5de376

Browse files
committed
Swift format updates
Updates to match latest swift-format configuration in swift-mmio.
1 parent 30b64bf commit d5de376

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.swift-format

Lines changed: 5 additions & 3 deletions
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,

.swiftformatignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
./harmony/*
2+
./stm32-neopixel/Sources/Application/Registers/*
3+
./stm32-uart-echo/Sources/Application/Registers/*

pico-blink-sdk/Main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct Main {
1414
static func main() {
1515
let led = UInt32(PICO_DEFAULT_LED_PIN)
1616
gpio_init(led)
17-
gpio_set_dir(led, /*out*/ true)
17+
gpio_set_dir(led, true)
1818
while true {
1919
gpio_put(led, true)
2020
sleep_ms(250)

stm32-lcd-logo/Support/HAL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ extension STM32F746 {
594594
b4Pin.configure(
595595
configuration: .init(
596596
mode: .alternateFunction, outputType: .pushPull, outputSpeed: .high,
597-
pull: .none, alternateFunction: .alternateFunction9 /*!*/,
597+
pull: .none, alternateFunction: .alternateFunction9,
598598
activeHigh: true))
599599
b5Pin.configure(
600600
configuration: .init(

0 commit comments

Comments
 (0)