Skip to content

Commit

Permalink
Disable force_try swiftlint rule for WinUIBackend
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stackotter committed Apr 8, 2024
1 parent 106fa54 commit e647b1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ excluded:
- Sources/SwiftCrossUI/Builders/ViewBuilder.swift
- Sources/SwiftCrossUI/Views/VariadicView.swift
- Sources/Gtk/Generated
- Examples/.build
4 changes: 4 additions & 0 deletions Sources/WinUIBackend/WinUIBackend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import WinAppSDK
import WinUI
import WindowsFoundation

// Many force tries are required for the WinUI backend but we don't really want them
// anywhere else so just disable them for this file.
// swiftlint:disable force_try

class WinRTApplication: SwiftApplication {
static var callback: () -> Void = {}

Expand Down

0 comments on commit e647b1c

Please sign in to comment.