317 lines
8.2 KiB
Text
317 lines
8.2 KiB
Text
# SwiftFormat Configuration
|
|
|
|
## Excluded folders
|
|
|
|
--exclude \
|
|
go, \
|
|
Pods, \
|
|
vendor
|
|
|
|
## Enabled rules
|
|
|
|
--rules \
|
|
acronyms, \
|
|
andOperator, \
|
|
anyObjectProtocol, \
|
|
assertionFailures, \
|
|
blankLineAfterImports, \
|
|
blankLinesAroundMark, \
|
|
blankLinesAtEndOfScope, \
|
|
blankLinesAtStartOfScope, \
|
|
blankLinesBetweenChainedFunctions, \
|
|
# blankLinesBetweenImports, \
|
|
blankLinesBetweenScopes, \
|
|
blockComments, \
|
|
braces, \
|
|
consecutiveBlankLines, \
|
|
consecutiveSpaces, \
|
|
duplicateImports, \
|
|
elseOnSameLine, \
|
|
emptyBraces, \
|
|
enumNamespaces, \
|
|
extensionAccessControl, \
|
|
fileHeader, \
|
|
# genericExtensions, \
|
|
headerFileName, \
|
|
hoistPatternLet, \
|
|
indent, \
|
|
initCoderUnavailable, \
|
|
isEmpty, \
|
|
leadingDelimiters, \
|
|
linebreakAtEndOfFile, \
|
|
linebreaks, \
|
|
modifierOrder, \
|
|
# markTypes, \
|
|
noExplicitOwnership, \
|
|
numberFormatting, \
|
|
# opaqueGenericParameters, \
|
|
# organizeDeclarations, \
|
|
# preferForLoop, \
|
|
preferKeyPath, \
|
|
redundantBackticks, \
|
|
redundantBreak, \
|
|
redundantClosure, \
|
|
redundantExtensionACL, \
|
|
redundantFileprivate, \
|
|
redundantGet, \
|
|
redundantInit, \
|
|
redundantInternal, \
|
|
redundantLet, \
|
|
redundantLetError, \
|
|
redundantNilInit, \
|
|
redundantObjc, \
|
|
# redundantOptionalBinding, \
|
|
redundantParens, \
|
|
redundantPattern, \
|
|
redundantRawValues, \
|
|
redundantReturn, \
|
|
redundantSelf, \
|
|
redundantStaticSelf, \
|
|
redundantType, \
|
|
redundantVoidReturnType, \
|
|
semicolons, \
|
|
sortImports, \
|
|
sortSwitchCases, \
|
|
sortTypealiases, \
|
|
spaceAroundBraces, \
|
|
spaceAroundBrackets, \
|
|
spaceAroundComments, \
|
|
spaceAroundGenerics, \
|
|
spaceAroundOperators, \
|
|
spaceAroundParens, \
|
|
spaceInsideBraces, \
|
|
spaceInsideBrackets, \
|
|
spaceInsideComments, \
|
|
spaceInsideGenerics, \
|
|
spaceInsideParens, \
|
|
# specifiers, \
|
|
strongOutlets, \
|
|
strongifiedSelf, \
|
|
todos, \
|
|
trailingClosures, \
|
|
trailingCommas, \
|
|
trailingSpace, \
|
|
typeSugar, \
|
|
unusedArguments, \
|
|
void, \
|
|
wrap, \
|
|
wrapArguments, \
|
|
wrapAttributes, \
|
|
wrapConditionalBodies, \
|
|
# wrapEnumCases, \
|
|
wrapLoopBodies, \
|
|
wrapMultilineConditionalAssignment, \
|
|
# wrapMultilineStatementBraces, \
|
|
wrapSingleLineComments, \
|
|
# wrapSwitchCases, \
|
|
yodaConditions
|
|
|
|
## Formatting options
|
|
|
|
### Acronyms to auto-capitalize. Defaults to "ID,URL,UUID".
|
|
|
|
--acronyms "GPG, HTTP, HTTPS, ID, PGP, SSH, URI, URL, UUID"
|
|
|
|
### Use allman indentation style: "true" or "false" (default)
|
|
|
|
--allman false
|
|
|
|
### Color/image literal width. "actual-width" or "visual-width"
|
|
|
|
--assetliterals visual-width
|
|
|
|
### Binary grouping,threshold (default: 4,8) or "none", "ignore"
|
|
|
|
--binarygrouping 4,8
|
|
|
|
### Closing paren position: "balanced" (default) or "same-line"
|
|
|
|
--closingparen balanced
|
|
|
|
### Commas in collection literals: "always" (default) or "inline"
|
|
|
|
--commas always
|
|
|
|
### Decimal grouping,threshold (default: 3,6) or "none", "ignore"
|
|
|
|
--decimalgrouping 3,6
|
|
|
|
### Placement of else/catch: "same-line" (default) or "next-line"
|
|
|
|
--elseposition same-line
|
|
|
|
### Empty braces: "no-space" (default), "spaced" or "linebreak"
|
|
|
|
--emptybraces no-space
|
|
|
|
### Enum namespaces: "always" (default) or "structs-only"
|
|
|
|
--enumnamespaces always
|
|
|
|
### Case of 'e' in numbers: "lowercase" or "uppercase" (default)
|
|
|
|
--exponentcase lowercase
|
|
|
|
### Group exponent digits: "enabled" or "disabled" (default)
|
|
|
|
--exponentgrouping disabled
|
|
|
|
### Place ACL "on-extension" (default) or "on-declarations"
|
|
|
|
--extensionacl on-extension
|
|
|
|
### Group digits after '.': "enabled" or "disabled" (default)
|
|
|
|
--fractiongrouping disabled
|
|
|
|
### Function @attributes: "preserve", "prev-line", or "same-line"
|
|
|
|
--funcattributes prev-line
|
|
|
|
### Guard else: "same-line", "next-line" or "auto" (default)
|
|
|
|
--guardelse auto
|
|
|
|
### Header comments: "strip", "ignore", or the text you wish use
|
|
|
|
--header ignore
|
|
|
|
### Hex grouping,threshold (default: 4,8) or "none", "ignore"
|
|
|
|
--hexgrouping 4,8
|
|
|
|
### Casing for hex literals: "uppercase" (default) or "lowercase"
|
|
|
|
--hexliteralcase uppercase
|
|
|
|
### #if indenting: "indent" (default), "no-indent" or "outdent"
|
|
|
|
--ifdef indent
|
|
|
|
### "testable-first", "testable-last", "alpha" (default) or "length"
|
|
|
|
--importgrouping testable-last
|
|
|
|
### Number of spaces to indent, or "tab" to use tabs
|
|
|
|
--indent 4
|
|
|
|
### Indent cases inside a switch: "true" or "false" (default)
|
|
|
|
--indentcase false
|
|
|
|
### Linebreak character to use: "cr", "crlf" or "lf" (default)
|
|
|
|
--linebreaks lf
|
|
|
|
### Maximum length of a line before wrapping. defaults to "none"
|
|
|
|
--maxwidth none
|
|
|
|
### Comma-delimited list of modifiers in preferred order
|
|
|
|
--modifierorder
|
|
|
|
### Comma-delimited list of operators without surrounding space
|
|
|
|
--nospaceoperators
|
|
|
|
### Comma-delimited list of operators that shouldn't be wrapped
|
|
|
|
--nowrapoperators
|
|
|
|
### Octal grouping,threshold (default: 4,8) or "none", "ignore"
|
|
|
|
--octalgrouping 4,8
|
|
|
|
### Spacing for operator funcs: "spaced" (default) or "no-space"
|
|
|
|
--operatorfunc spaced
|
|
|
|
### let/var placement in patterns: "hoist" (default) or "inline"
|
|
|
|
--patternlet hoist
|
|
|
|
### Explicit self: "insert", "remove" (default) or "init-only"
|
|
|
|
--self init-only
|
|
|
|
### Comma-delimited list of functions with @autoclosure arguments
|
|
|
|
--selfrequired
|
|
|
|
### Allow semicolons: "never" or "inline" (default)
|
|
|
|
--semicolons inline
|
|
|
|
### Use ? for Optionals "always" (default) or "except-properties"
|
|
|
|
--shortoptionals always
|
|
|
|
### Align code independently of tab width. defaults to "enabled"
|
|
|
|
--smarttabs enabled
|
|
|
|
### "closure-only", "unnamed-only" or "always" (default)
|
|
|
|
--stripunusedargs always
|
|
|
|
### The width of a tab character. Defaults to "unspecified"
|
|
|
|
--tabwidth 4
|
|
|
|
### Comma-delimited list of functions that use trailing closures
|
|
|
|
--trailingclosures
|
|
|
|
### Trim trailing space: "always" (default) or "nonblank-lines"
|
|
|
|
--trimwhitespace always
|
|
|
|
### Type @attributes: "preserve", "prev-line", or "same-line"
|
|
|
|
--typeattributes preserve
|
|
|
|
### Property @attributes: "preserve", "prev-line", or "same-line"
|
|
|
|
--varattributes same-line
|
|
|
|
### How Void types are represented: "void" (default) or "tuple"
|
|
|
|
--voidtype void
|
|
|
|
### Wrap all arguments: "before-first", "after-first", "preserve"
|
|
|
|
--wraparguments preserve
|
|
|
|
### Wrap array/dict: "before-first", "after-first", "preserve"
|
|
|
|
--wrapcollections preserve
|
|
|
|
### Wrap conditions: "before-first", "after-first", "preserve"
|
|
|
|
--wrapconditions preserve
|
|
|
|
### Wrap func params: "before-first", "after-first", "preserve"
|
|
|
|
--wrapparameters preserve
|
|
|
|
### Wrap return type: "if-multiline", "preserve" (default)
|
|
|
|
--wrapreturntype preserve
|
|
|
|
### Wrap ternary operators: "default", "before-operators"
|
|
|
|
--wrapternary before-operators
|
|
|
|
### Wrap typealiases: "before-first", "after-first", "preserve"
|
|
|
|
--wraptypealiases preserve
|
|
|
|
### Xcode indent guard/enum: "enabled" or "disabled" (default)
|
|
|
|
--xcodeindentation disabled
|
|
|
|
### Swap yoda values: "always" (default) or "literals-only"
|
|
|
|
--yodaswap always
|