Skip to content

Commit a56ead0

Browse files
authored
format everything (#22)
1 parent 70f2a19 commit a56ead0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+706
-468
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
license_header_check_project_name: "Swift Profile Recorder"
1313
python_lint_check_enabled: false
1414
docs_check_enabled: false
15-
format_check_enabled: false
15+
format_check_enabled: true
1616

1717
swift-test:
1818
name: Run tests

.swift-format

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

Package.swift

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "swift-profile-recorder",
88
platforms: [
9-
.macOS(.v11), .iOS(.v14), .watchOS(.v7), .tvOS(.v14)
9+
.macOS(.v11), .iOS(.v14), .watchOS(.v7), .tvOS(.v14),
1010
],
1111
products: [
1212
.library(name: "ProfileRecorder", targets: ["ProfileRecorder"]),
@@ -33,7 +33,8 @@ let package = Package(
3333
.product(name: "ArgumentParser", package: "swift-argument-parser"),
3434
.product(name: "NIO", package: "swift-nio"),
3535
.product(name: "Logging", package: "swift-log"),
36-
]),
36+
]
37+
),
3738
.target(
3839
name: "ProfileRecorderSampleConversion",
3940
dependencies: [
@@ -46,7 +47,8 @@ let package = Package(
4647
.product(name: "NIOFoundationCompat", package: "swift-nio"),
4748
.product(name: "Logging", package: "swift-log"),
4849
.product(name: "NIOExtras", package: "swift-nio-extras"),
49-
]),
50+
]
51+
),
5052
.executableTarget(
5153
name: "swipr-sample-conv",
5254
dependencies: [
@@ -56,7 +58,8 @@ let package = Package(
5658
"ProfileRecorder",
5759
.product(name: "ArgumentParser", package: "swift-argument-parser"),
5860
.product(name: "Logging", package: "swift-log"),
59-
]),
61+
]
62+
),
6063

6164
// MARK: - Library targets
6265
.target(
@@ -116,40 +119,44 @@ let package = Package(
116119
),
117120

118121
// MARK: - Tests
119-
.testTarget(name: "ProfileRecorderTests",
120-
dependencies: [
121-
"ProfileRecorder",
122-
"ProfileRecorderSampleConversion",
123-
"ProfileRecorderHelpers",
124-
.product(name: "Atomics", package: "swift-atomics"),
125-
.product(name: "NIO", package: "swift-nio"),
126-
.product(name: "Logging", package: "swift-log"),
127-
.product(name: "_NIOFileSystem", package: "swift-nio"),
128-
]),
129-
.testTarget(name: "ProfileRecorderServerTests",
130-
dependencies: [
131-
"ProfileRecorder",
132-
"ProfileRecorderServer",
133-
"ProfileRecorderSampleConversion",
134-
"ProfileRecorderHelpers",
135-
.product(name: "Atomics", package: "swift-atomics"),
136-
.product(name: "NIO", package: "swift-nio"),
137-
.product(name: "Logging", package: "swift-log"),
138-
.product(name: "_NIOFileSystem", package: "swift-nio"),
139-
.product(name: "AsyncHTTPClient", package: "async-http-client"),
140-
]
141-
),
142-
.testTarget(name: "ProfileRecorderSampleConversionTests",
143-
dependencies: [
144-
"ProfileRecorder",
145-
"ProfileRecorderSampleConversion",
146-
"ProfileRecorderHelpers",
147-
.product(name: "Atomics", package: "swift-atomics"),
148-
.product(name: "NIO", package: "swift-nio"),
149-
.product(name: "Logging", package: "swift-log"),
150-
.product(name: "_NIOFileSystem", package: "swift-nio"),
151-
]
152-
),
122+
.testTarget(
123+
name: "ProfileRecorderTests",
124+
dependencies: [
125+
"ProfileRecorder",
126+
"ProfileRecorderSampleConversion",
127+
"ProfileRecorderHelpers",
128+
.product(name: "Atomics", package: "swift-atomics"),
129+
.product(name: "NIO", package: "swift-nio"),
130+
.product(name: "Logging", package: "swift-log"),
131+
.product(name: "_NIOFileSystem", package: "swift-nio"),
132+
]
133+
),
134+
.testTarget(
135+
name: "ProfileRecorderServerTests",
136+
dependencies: [
137+
"ProfileRecorder",
138+
"ProfileRecorderServer",
139+
"ProfileRecorderSampleConversion",
140+
"ProfileRecorderHelpers",
141+
.product(name: "Atomics", package: "swift-atomics"),
142+
.product(name: "NIO", package: "swift-nio"),
143+
.product(name: "Logging", package: "swift-log"),
144+
.product(name: "_NIOFileSystem", package: "swift-nio"),
145+
.product(name: "AsyncHTTPClient", package: "async-http-client"),
146+
]
147+
),
148+
.testTarget(
149+
name: "ProfileRecorderSampleConversionTests",
150+
dependencies: [
151+
"ProfileRecorder",
152+
"ProfileRecorderSampleConversion",
153+
"ProfileRecorderHelpers",
154+
.product(name: "Atomics", package: "swift-atomics"),
155+
.product(name: "NIO", package: "swift-nio"),
156+
.product(name: "Logging", package: "swift-log"),
157+
.product(name: "_NIOFileSystem", package: "swift-nio"),
158+
]
159+
),
153160
],
154161
cxxLanguageStandard: .cxx14
155162
)

Scripts/vendor-core-symbolication-symbolizer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ vendored_file_text='//===-------------------------------------------------------
8888
//
8989
//===----------------------------------------------------------------------===//
9090
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
91+
// swift-format-ignore-file
9192
'
9293

9394
find . -name "swipr-core-symbolication.h" -exec gsed -ri \

Scripts/vendor-native-symbolizer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ vendored_file_text='//===-------------------------------------------------------
112112
//
113113
//===----------------------------------------------------------------------===//
114114
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
115+
// swift-format-ignore-file
115116
'
116117

117118
find "$target_c_src" "$target_swift_src" \

Sources/CProfileRecorderDarwin/include/swipr-core-symbolication.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
15+
// swift-format-ignore-file
1516
//===--- Darwin.h - Darwin specifics ----------------------------*- C++ -*-===//
1617
//
1718
// This source file is part of the Swift.org open source project

Sources/CProfileRecorderSwiftELF/empty.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
15+
// swift-format-ignore-file
1516

1617
//===----------------------------------------------------------------------===//
1718
//

Sources/CProfileRecorderSwiftELF/include/CProfileRecorderSwiftELF.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
15+
// swift-format-ignore-file
1516

1617
//===----------------------------------------------------------------------===//
1718
//

Sources/CProfileRecorderSwiftELF/include/swipr-dwarf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
15+
// swift-format-ignore-file
1516

1617
//===--- dwarf.h - Definitions of DWARF structures for import into Swift --===//
1718
//

Sources/CProfileRecorderSwiftELF/include/swipr-eh_frame_hdr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414
// This file has been adjusted for ProfileRecorder, originally of the Swift.org open source project
15+
// swift-format-ignore-file
1516

1617
//===--- eh_frame_hdr.h - DWARF EH frame header definitions ---------------===//
1718
//

0 commit comments

Comments
 (0)