nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 639 forks source link

Unexpected token } with @unchecked enum #1239

Closed ShamrinIgor closed 2 years ago

ShamrinIgor commented 2 years ago

Hello! I noticed that when I run swiftromat with file with enum MyEnum: @unchecked Sendable, Hashable (regardless of setting the --lint flag), I get an error error: Unexpected token } at *string with a closing enum parenthesis*. Here is an example of problematic code

public enum Action: @unchecked Sendable, Hashable {
    case openURL(URL)
}

My SwiftFormat version is 0.49.13. This is my .swiftformat file:

--closingparen balanced
--commas inline
--decimalgrouping 3,3
--exclude **/AutoRuProtoModels,**/GeneratedBackendMethod.swift
--extensionacl on-declarations
--header strip
--ifdef no-indent
--importgrouping testable-bottom
--indent 4
--maxwidth 120
--modifierorder public,override
--stripunusedargs closure-only
--wraparguments before-first
--wrapcollections before-first
--swiftversion 5.6.0

--disable blankLinesAtEndOfScope,blankLinesAtStartOfScope,preferKeyPath,strongOutlets
nicklockwood commented 2 years ago

@ShamrinIgor fixed in 0.49.14