enum Flag: String, Codable {
case `init`
}
let flags: [Flag] = [.`init`]
Execute swiftformat to this code will remove the back quotes.
Backquote must not be deleted because init is reserved.
$ swiftformat --version
0.45.0
$ cat .swiftformat
# format options
# file options
--exclude */modules, Pods, Carthage, fastlane, GeneratedMocks.swift
# rules
--disable trailingClosures, wrapMultilineStatementBraces
--stripunusedargs closure-only
# version
--swiftversion 5
@soranoba thanks for reporting this, I'll fix it in the next release. In the meantime, you can work around it by adding the following comment in the line above:
// swiftformat:disable:next redundantBackticks
let flags: [Flag] = [.`init`]
Or just disable the redundantBackticks rule globally in your SwiftFormat configuration.
Thank you for the quick response.
@soranoba fixed in 0.45.2.