Skip to content

Instantly share code, notes, and snippets.

@bocato
Created January 19, 2024 07:59
Show Gist options
  • Save bocato/8be8444f77a1bc6f2d0015c9bea0f441 to your computer and use it in GitHub Desktop.
Save bocato/8be8444f77a1bc6f2d0015c9bea0f441 to your computer and use it in GitHub Desktop.
swiftformat.config
# General Options
--swiftversion 5.7
# File Options
--exclude **.generated.swift, **.testing.swift ## use this to exclude whatever you need, in my case I have all generated files and testing utils with the extensions presented here.
# Format Options
--allman false
--binarygrouping none
--closingparen balanced
--commas always
--conflictmarkers reject
--decimalgrouping none
--elseposition same-line
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
--fragment false
--header strip
--hexgrouping none
--hexliteralcase lowercase
--ifdef no-indent
--importgrouping alphabetized
--indent 4
--indentcase false
# Below here we need to be sure it matches .swiftlint file.
--maxwidth 180
--nospaceoperators ..<,...
--octalgrouping none
--operatorfunc no-space
--stripunusedargs closure-only
--wraparguments before-first
--wrapcollections before-first
--wrapparameters before-first
# Explicitly Enabled Rules
--enable docComments
--enable --selfrequired
--enable strongifiedSelf
--enable trailingclosures
# Disabled Rules
--disable linebreakAtEndOfFile
--disable hoistAwait
--disable wrapMultilineStatementBraces
--disable extensionAccessControl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment