Skip to content

Instantly share code, notes, and snippets.

@hoppsen
Created May 4, 2022 05:12
Show Gist options
  • Save hoppsen/1f4768d1240ee4289c361d811b266649 to your computer and use it in GitHub Desktop.
Save hoppsen/1f4768d1240ee4289c361d811b266649 to your computer and use it in GitHub Desktop.
My default configuration file for SwiftFormat.
# file options
--exclude Pods,**/.build,**/Package.swift,vendor/bundle,scripts,fastlane,**/L10n.swift,**/Assets.swift,**/*.generated.swift
# format options
--swiftversion 5.5
## elseOnSameLine
--guardelse same-line
## wrap
--maxwidth 160
## wrapArguments
--wraparguments after-first
--wrapparameters after-first
--wrapcollections after-first
--wrapconditions after-first
## organizeDeclarations
# --categorymark "MARK: - %c"
# --structthreshold 9999
# --classthreshold 9999
# --enumthreshold 100
# --extensionlength 100
# rules
--enable isEmpty, organizeDeclarations
--disable enumNamespaces, wrapMultilineStatementBraces
# Interesting rules
# --enable organizeDeclarations
# --enable sortedSwitchCases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment