Skip to content

Commit 7528100

Browse files
committed
Fix lint issues in stm32-lvgl
1 parent 7b2e2d1 commit 7528100

File tree

5 files changed

+84
-10
lines changed

5 files changed

+84
-10
lines changed

.swiftformatignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
./harmony/*
22
./stm32-lcd-logo/Sources/Application/Registers/*
3+
./stm32-lvgl/Sources/Registers/*
34
./stm32-neopixel/Sources/Application/Registers/*
45
./stm32-uart-echo/Sources/Application/Registers/*

Tools/elf2hex.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ def emit(vmaddr, data):
8585
flags += "r" if segment.header.p_flags & 0x4 else "-"
8686
flags += "w" if segment.header.p_flags & 0x2 else "-"
8787
flags += "x" if segment.header.p_flags & 0x1 else "-"
88-
print(f"PT_LOAD {flags} at 0x{segment.header.p_paddr:08x} - 0x{segment.header.p_paddr + len(data):08x}, size {len(data)} (0x{len(data):04x})")
88+
print(f"PT_LOAD {flags} at 0x{segment.header.p_paddr:08x} - "
89+
f"0x{segment.header.p_paddr + len(data):08x}, "
90+
f"size {len(data)} "
91+
f"(0x{len(data):04x})")
8992
placement_addr = segment.header.p_paddr
9093
if segment.header.p_paddr in relocations:
9194
placement_addr = relocations[segment.header.p_paddr]

stm32-lvgl/.swift-format

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
11
{
2-
"lineLength" : 120
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentation" : {
6+
"spaces" : 2
7+
},
8+
"indentConditionalCompilationBlocks" : false,
9+
"indentSwitchCaseLabels" : false,
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineLength" : 120,
15+
"maximumBlankLines" : 1,
16+
"multiElementCollectionTrailingCommas" : true,
17+
"noAssignmentInExpressions" : {
18+
"allowedFunctions" : [
19+
"XCTAssertNoThrow"
20+
]
21+
},
22+
"prioritizeKeepingFunctionOutputTogether" : false,
23+
"respectsExistingLineBreaks" : true,
24+
"rules" : {
25+
"AllPublicDeclarationsHaveDocumentation" : false,
26+
"AlwaysUseLiteralForEmptyCollectionInit" : true,
27+
"AlwaysUseLowerCamelCase" : false,
28+
"AmbiguousTrailingClosureOverload" : false,
29+
"BeginDocumentationCommentWithOneLineSummary" : false,
30+
"DoNotUseSemicolons" : true,
31+
"DontRepeatTypeInStaticProperties" : true,
32+
"FileScopedDeclarationPrivacy" : true,
33+
"FullyIndirectEnum" : true,
34+
"GroupNumericLiterals" : true,
35+
"IdentifiersMustBeASCII" : true,
36+
"NeverForceUnwrap" : false,
37+
"NeverUseForceTry" : true,
38+
"NeverUseImplicitlyUnwrappedOptionals" : false,
39+
"NoAccessLevelOnExtensionDeclaration" : true,
40+
"NoAssignmentInExpressions" : true,
41+
"NoBlockComments" : false,
42+
"NoCasesWithOnlyFallthrough" : true,
43+
"NoEmptyTrailingClosureParentheses" : true,
44+
"NoLabelsInCasePatterns" : true,
45+
"NoLeadingUnderscores" : false,
46+
"NoParensAroundConditions" : true,
47+
"NoPlaygroundLiterals" : true,
48+
"NoVoidReturnOnFunctionSignature" : true,
49+
"OmitExplicitReturns" : false,
50+
"OneCasePerLine" : true,
51+
"OneVariableDeclarationPerLine" : true,
52+
"OnlyOneTrailingClosureArgument" : true,
53+
"OrderedImports" : true,
54+
"ReplaceForEachWithForLoop" : true,
55+
"ReturnVoidInsteadOfEmptyTuple" : true,
56+
"TypeNamesShouldBeCapitalized" : true,
57+
"UseEarlyExits" : false,
58+
"UseExplicitNilCheckInConditions" : true,
59+
"UseLetInEveryBoundCaseVariable" : true,
60+
"UseShorthandTypeNames" : true,
61+
"UseSingleLinePropertyGetter" : true,
62+
"UseSynthesizedInitializer" : true,
63+
"UseTripleSlashForDocumentationComments" : true,
64+
"UseWhereClausesInForLoops" : false,
65+
"ValidateDocumentationComments" : true
66+
},
67+
"spacesBeforeEndOfLineComments": 2,
68+
"spacesAroundRangeFormationOperators" : false,
69+
"tabWidth" : 2,
70+
"version" : 1
371
}

stm32-lvgl/Package.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ let package = Package(
1414
.package(url: "https://github.com/apple/swift-mmio", branch: "main")
1515
],
1616
targets: [
17-
.executableTarget(name: "Application",
17+
.executableTarget(
18+
name: "Application",
1819
dependencies: [
1920
"Registers",
2021
"Support",
@@ -28,12 +29,13 @@ let package = Package(
2829
// GPIOA GPIOB GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH GPIOI GPIOJ GPIOK \
2930
// I2C1 I2C2 I2C3 I2C4 \
3031
// --access-level public
31-
.target(name: "Registers",
32+
.target(
33+
name: "Registers",
3234
dependencies: [
33-
.product(name: "MMIO", package: "swift-mmio"),
35+
.product(name: "MMIO", package: "swift-mmio")
3436
]),
3537

3638
.target(name: "Support"),
37-
39+
3840
.target(name: "CLVGL"),
3941
])

stm32-lvgl/fetch-dependencies.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ set -vex
88

99
VER=19.1.5
1010

11-
if [[ "`uname -s`" == "Darwin" ]]; then
11+
if [[ "$(uname -s)" == "Darwin" ]]; then
1212
FILE=LLVM-ET-Arm-${VER}-Darwin-universal
1313
EXT=dmg
1414
SHA=0451e67dc9a9066c17f746c26654962fa3889d4df468db1245d1bae69438eaf5
15-
elif [[ "`uname -s`" == "Linux" && "`uname -m`" == "aarch64" ]]; then
15+
elif [[ "$(uname -s)" == "Linux" && "$(uname -m)" == "aarch64" ]]; then
1616
FILE=LLVM-ET-Arm-${VER}-Linux-AArch64
1717
EXT=tar.xz
1818
SHA=5e2f6b8c77464371ae2d7445114b4bdc19f56138e8aa864495181b52f57d0b85
19-
elif [[ "`uname -s`" == "Linux" && "`uname -m`" == "x86_64" ]]; then
19+
elif [[ "$(uname -s)" == "Linux" && "$(uname -m)" == "x86_64" ]]; then
2020
FILE=LLVM-ET-Arm-${VER}-Linux-x86_64
2121
EXT=tar.xz
2222
SHA=34ee877aadc78c5e9f067e603a1bc9745ed93ca7ae5dbfc9b4406508dc153920
2323
else
24-
echo "No LLVM toolchain for this OS/arch (`uname -s`, `uname -m`)"
24+
echo "No LLVM toolchain for this OS/arch ($(uname -s), $(uname -m))"
2525
exit 1
2626
fi
2727

0 commit comments

Comments
 (0)