Skip to content

Commit e647b1c

Browse files
committed
Disable force_try swiftlint rule for WinUIBackend
Other backends use plenty of force unwraps so it's justifiable, maybe one day we'll have a centralized way of handling these preconditions, but either way there's no option other than to exit/crash
1 parent 106fa54 commit e647b1c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.swiftlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ excluded:
2222
- Sources/SwiftCrossUI/Builders/ViewBuilder.swift
2323
- Sources/SwiftCrossUI/Views/VariadicView.swift
2424
- Sources/Gtk/Generated
25+
- Examples/.build

Sources/WinUIBackend/WinUIBackend.swift

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import WinAppSDK
44
import WinUI
55
import WindowsFoundation
66

7+
// Many force tries are required for the WinUI backend but we don't really want them
8+
// anywhere else so just disable them for this file.
9+
// swiftlint:disable force_try
10+
711
class WinRTApplication: SwiftApplication {
812
static var callback: () -> Void = {}
913

0 commit comments

Comments
 (0)