Skip to content

Commit 44ebc38

Browse files
authored
Merge pull request #732 from swiftwasm/kr/swift-format-ignore-generated
BridgeJS: Add swift-format-ignore-file to generated Swift sources
2 parents f483b91 + 1c107ad commit 44ebc38

12 files changed

Lines changed: 64 additions & 26 deletions

File tree

Benchmarks/Sources/Generated/BridgeJS.Macros.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// swift-format-ignore-file
12
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
23
// DO NOT EDIT.
34
//

Benchmarks/Sources/Generated/BridgeJS.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// bridge-js: skip
2+
// swift-format-ignore-file
23
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
34
// DO NOT EDIT.
45
//

Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.Macros.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// swift-format-ignore-file
12
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
23
// DO NOT EDIT.
34
//

Examples/PlayBridgeJS/Sources/PlayBridgeJS/Generated/BridgeJS.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// bridge-js: skip
2+
// swift-format-ignore-file
23
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
34
// DO NOT EDIT.
45
//

Plugins/BridgeJS/Sources/BridgeJSUtilities/Utilities.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public enum BridgeJSGeneratedFile {
1717
// The generated Swift file itself should not be processed by BridgeJS again.
1818
"""
1919
\(skipLine)
20+
// swift-format-ignore-file
2021
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
2122
// DO NOT EDIT.
2223
//

Plugins/BridgeJS/Sources/TS2Swift/JavaScript/src/cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export function run(filePaths, options) {
149149
}
150150

151151
const prelude = [
152+
"// swift-format-ignore-file",
152153
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,",
153154
"// DO NOT EDIT.",
154155
"//",

Plugins/BridgeJS/Sources/TS2Swift/JavaScript/test/__snapshots__/ts2swift.test.js.snap

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`ts2swift > snapshots Swift output for ArrayParameter.d.ts > ArrayParameter 1`] = `
4-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
4+
"// swift-format-ignore-file
5+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
56
// DO NOT EDIT.
67
//
78
// To update this file, just rebuild your project or run
@@ -24,7 +25,8 @@ exports[`ts2swift > snapshots Swift output for ArrayParameter.d.ts > ArrayParame
2425
`;
2526

2627
exports[`ts2swift > snapshots Swift output for Async.d.ts > Async 1`] = `
27-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
28+
"// swift-format-ignore-file
29+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
2830
// DO NOT EDIT.
2931
//
3032
// To update this file, just rebuild your project or run
@@ -49,7 +51,8 @@ exports[`ts2swift > snapshots Swift output for Async.d.ts > Async 1`] = `
4951
`;
5052

5153
exports[`ts2swift > snapshots Swift output for CallableConst.d.ts > CallableConst 1`] = `
52-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
54+
"// swift-format-ignore-file
55+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
5356
// DO NOT EDIT.
5457
//
5558
// To update this file, just rebuild your project or run
@@ -65,7 +68,8 @@ exports[`ts2swift > snapshots Swift output for CallableConst.d.ts > CallableCons
6568
`;
6669

6770
exports[`ts2swift > snapshots Swift output for Documentation.d.ts > Documentation 1`] = `
68-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
71+
"// swift-format-ignore-file
72+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
6973
// DO NOT EDIT.
7074
//
7175
// To update this file, just rebuild your project or run
@@ -122,7 +126,8 @@ exports[`ts2swift > snapshots Swift output for Documentation.d.ts > Documentatio
122126
`;
123127

124128
exports[`ts2swift > snapshots Swift output for ExportAssignment.d.ts > ExportAssignment 1`] = `
125-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
129+
"// swift-format-ignore-file
130+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
126131
// DO NOT EDIT.
127132
//
128133
// To update this file, just rebuild your project or run
@@ -135,7 +140,8 @@ exports[`ts2swift > snapshots Swift output for ExportAssignment.d.ts > ExportAss
135140
`;
136141

137142
exports[`ts2swift > snapshots Swift output for Interface.d.ts > Interface 1`] = `
138-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
143+
"// swift-format-ignore-file
144+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
139145
// DO NOT EDIT.
140146
//
141147
// To update this file, just rebuild your project or run
@@ -153,7 +159,8 @@ exports[`ts2swift > snapshots Swift output for Interface.d.ts > Interface 1`] =
153159
`;
154160

155161
exports[`ts2swift > snapshots Swift output for InvalidPropertyNames.d.ts > InvalidPropertyNames 1`] = `
156-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
162+
"// swift-format-ignore-file
163+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
157164
// DO NOT EDIT.
158165
//
159166
// To update this file, just rebuild your project or run
@@ -201,7 +208,8 @@ exports[`ts2swift > snapshots Swift output for InvalidPropertyNames.d.ts > Inval
201208
`;
202209
203210
exports[`ts2swift > snapshots Swift output for MultipleImportedTypes.d.ts > MultipleImportedTypes 1`] = `
204-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
211+
"// swift-format-ignore-file
212+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
205213
// DO NOT EDIT.
206214
//
207215
// To update this file, just rebuild your project or run
@@ -238,7 +246,8 @@ exports[`ts2swift > snapshots Swift output for MultipleImportedTypes.d.ts > Mult
238246
`;
239247
240248
exports[`ts2swift > snapshots Swift output for ObjectLikeTypes.d.ts > ObjectLikeTypes 1`] = `
241-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
249+
"// swift-format-ignore-file
250+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
242251
// DO NOT EDIT.
243252
//
244253
// To update this file, just rebuild your project or run
@@ -251,7 +260,8 @@ exports[`ts2swift > snapshots Swift output for ObjectLikeTypes.d.ts > ObjectLike
251260
`;
252261
253262
exports[`ts2swift > snapshots Swift output for OptionalNullUndefined.d.ts > OptionalNullUndefined 1`] = `
254-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
263+
"// swift-format-ignore-file
264+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
255265
// DO NOT EDIT.
256266
//
257267
// To update this file, just rebuild your project or run
@@ -292,7 +302,8 @@ exports[`ts2swift > snapshots Swift output for OptionalNullUndefined.d.ts > Opti
292302
`;
293303
294304
exports[`ts2swift > snapshots Swift output for PrimitiveParameters.d.ts > PrimitiveParameters 1`] = `
295-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
305+
"// swift-format-ignore-file
306+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
296307
// DO NOT EDIT.
297308
//
298309
// To update this file, just rebuild your project or run
@@ -305,7 +316,8 @@ exports[`ts2swift > snapshots Swift output for PrimitiveParameters.d.ts > Primit
305316
`;
306317
307318
exports[`ts2swift > snapshots Swift output for PrimitiveReturn.d.ts > PrimitiveReturn 1`] = `
308-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
319+
"// swift-format-ignore-file
320+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
309321
// DO NOT EDIT.
310322
//
311323
// To update this file, just rebuild your project or run
@@ -320,7 +332,8 @@ exports[`ts2swift > snapshots Swift output for PrimitiveReturn.d.ts > PrimitiveR
320332
`;
321333
322334
exports[`ts2swift > snapshots Swift output for ReExportFrom.d.ts > ReExportFrom 1`] = `
323-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
335+
"// swift-format-ignore-file
336+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
324337
// DO NOT EDIT.
325338
//
326339
// To update this file, just rebuild your project or run
@@ -338,7 +351,8 @@ exports[`ts2swift > snapshots Swift output for ReExportFrom.d.ts > ReExportFrom
338351
`;
339352
340353
exports[`ts2swift > snapshots Swift output for RecordDictionary.d.ts > RecordDictionary 1`] = `
341-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
354+
"// swift-format-ignore-file
355+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
342356
// DO NOT EDIT.
343357
//
344358
// To update this file, just rebuild your project or run
@@ -368,7 +382,8 @@ exports[`ts2swift > snapshots Swift output for RecordDictionary.d.ts > RecordDic
368382
`;
369383
370384
exports[`ts2swift > snapshots Swift output for StaticProperty.d.ts > StaticProperty 1`] = `
371-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
385+
"// swift-format-ignore-file
386+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
372387
// DO NOT EDIT.
373388
//
374389
// To update this file, just rebuild your project or run
@@ -384,7 +399,8 @@ exports[`ts2swift > snapshots Swift output for StaticProperty.d.ts > StaticPrope
384399
`;
385400
386401
exports[`ts2swift > snapshots Swift output for StringEnum.d.ts > StringEnum 1`] = `
387-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
402+
"// swift-format-ignore-file
403+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
388404
// DO NOT EDIT.
389405
//
390406
// To update this file, just rebuild your project or run
@@ -405,7 +421,8 @@ extension FeatureFlag: _BridgedSwiftEnumNoPayload, _BridgedSwiftRawValueEnum {}
405421
`;
406422
407423
exports[`ts2swift > snapshots Swift output for StringLiteralUnion.d.ts > StringLiteralUnion 1`] = `
408-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
424+
"// swift-format-ignore-file
425+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
409426
// DO NOT EDIT.
410427
//
411428
// To update this file, just rebuild your project or run
@@ -426,7 +443,8 @@ extension Direction: _BridgedSwiftEnumNoPayload, _BridgedSwiftRawValueEnum {}
426443
`;
427444
428445
exports[`ts2swift > snapshots Swift output for StringParameter.d.ts > StringParameter 1`] = `
429-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
446+
"// swift-format-ignore-file
447+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
430448
// DO NOT EDIT.
431449
//
432450
// To update this file, just rebuild your project or run
@@ -441,7 +459,8 @@ exports[`ts2swift > snapshots Swift output for StringParameter.d.ts > StringPara
441459
`;
442460
443461
exports[`ts2swift > snapshots Swift output for StringReturn.d.ts > StringReturn 1`] = `
444-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
462+
"// swift-format-ignore-file
463+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
445464
// DO NOT EDIT.
446465
//
447466
// To update this file, just rebuild your project or run
@@ -454,7 +473,8 @@ exports[`ts2swift > snapshots Swift output for StringReturn.d.ts > StringReturn
454473
`;
455474
456475
exports[`ts2swift > snapshots Swift output for TS2SkeletonLike.d.ts > TS2SkeletonLike 1`] = `
457-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
476+
"// swift-format-ignore-file
477+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
458478
// DO NOT EDIT.
459479
//
460480
// To update this file, just rebuild your project or run
@@ -480,7 +500,8 @@ exports[`ts2swift > snapshots Swift output for TS2SkeletonLike.d.ts > TS2Skeleto
480500
`;
481501
482502
exports[`ts2swift > snapshots Swift output for TypeAlias.d.ts > TypeAlias 1`] = `
483-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
503+
"// swift-format-ignore-file
504+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
484505
// DO NOT EDIT.
485506
//
486507
// To update this file, just rebuild your project or run
@@ -493,7 +514,8 @@ exports[`ts2swift > snapshots Swift output for TypeAlias.d.ts > TypeAlias 1`] =
493514
`;
494515
495516
exports[`ts2swift > snapshots Swift output for TypeAliasObject.d.ts > TypeAliasObject 1`] = `
496-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
517+
"// swift-format-ignore-file
518+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
497519
// DO NOT EDIT.
498520
//
499521
// To update this file, just rebuild your project or run
@@ -512,7 +534,8 @@ exports[`ts2swift > snapshots Swift output for TypeAliasObject.d.ts > TypeAliasO
512534
`;
513535
514536
exports[`ts2swift > snapshots Swift output for TypeScriptClass.d.ts > TypeScriptClass 1`] = `
515-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
537+
"// swift-format-ignore-file
538+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
516539
// DO NOT EDIT.
517540
//
518541
// To update this file, just rebuild your project or run
@@ -533,7 +556,8 @@ exports[`ts2swift > snapshots Swift output for TypeScriptClass.d.ts > TypeScript
533556
`;
534557
535558
exports[`ts2swift > snapshots Swift output for VoidParameterVoidReturn.d.ts > VoidParameterVoidReturn 1`] = `
536-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
559+
"// swift-format-ignore-file
560+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
537561
// DO NOT EDIT.
538562
//
539563
// To update this file, just rebuild your project or run
@@ -546,7 +570,8 @@ exports[`ts2swift > snapshots Swift output for VoidParameterVoidReturn.d.ts > Vo
546570
`;
547571
548572
exports[`ts2swift > snapshots Swift output for WebIDLDOMDocs.d.ts > WebIDLDOMDocs 1`] = `
549-
"// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
573+
"// swift-format-ignore-file
574+
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
550575
// DO NOT EDIT.
551576
//
552577
// To update this file, just rebuild your project or run

Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/SwiftTypedClosureAccess.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,8 @@
281281
}
282282
]
283283
},
284-
"moduleName" : "TestModule"
284+
"moduleName" : "TestModule",
285+
"usedExternalModules" : [
286+
287+
]
285288
}

Tests/BridgeJSGlobalTests/Generated/BridgeJS.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// bridge-js: skip
2+
// swift-format-ignore-file
23
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
34
// DO NOT EDIT.
45
//

Tests/BridgeJSIdentityTests/Generated/BridgeJS.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// bridge-js: skip
2+
// swift-format-ignore-file
23
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
34
// DO NOT EDIT.
45
//

0 commit comments

Comments
 (0)