Polish SwiftLint and SwiftFormat configurations
This commit is contained in:
parent
8459af4196
commit
2b7b378e12
2 changed files with 218 additions and 52 deletions
257
.swiftformat
257
.swiftformat
|
|
@ -1,96 +1,257 @@
|
|||
# Exclude folders
|
||||
# SwiftFormat Configuration
|
||||
|
||||
--exclude Carthage,go,Pods
|
||||
## Excluded folders
|
||||
|
||||
# Enabled rules
|
||||
--exclude \
|
||||
Carthage, \
|
||||
go, \
|
||||
Pods
|
||||
|
||||
--rules andOperator, anyObjectProtocol, blankLinesAroundMark, blankLinesAtEndOfScope, blankLinesAtStartOfScope, blankLinesBetweenScopes, braces, consecutiveBlankLines, consecutiveSpaces, duplicateImports, elseOnSameLine, emptyBraces, fileHeader, hoistPatternLet, indent, isEmpty, initCoderUnavailable, leadingDelimiters, linebreakAtEndOfFile, linebreaks, modifierOrder, numberFormatting, preferKeyPath, redundantBackticks, redundantBreak, redundantExtensionACL, redundantFileprivate, redundantGet, redundantInit, redundantLet, redundantLetError, redundantNilInit, redundantObjc, redundantParens, redundantPattern, redundantRawValues, redundantReturn, redundantSelf, redundantType, redundantVoidReturnType, semicolons, sortedImports, spaceAroundBraces, spaceAroundBrackets, spaceAroundComments, spaceAroundGenerics, spaceAroundOperators, spaceAroundParens, spaceInsideBraces, spaceInsideBrackets, spaceInsideComments, spaceInsideGenerics, spaceInsideParens, strongOutlets, strongifiedSelf, todos, trailingClosures, trailingCommas, trailingSpace, typeSugar, unusedArguments, void, wrap, wrapArguments, wrapAttributes, yodaConditions
|
||||
## Enabled rules
|
||||
|
||||
# Formatting options
|
||||
--rules \
|
||||
andOperator, \
|
||||
anyObjectProtocol, \
|
||||
blankLinesAroundMark, \
|
||||
blankLinesAtEndOfScope, \
|
||||
blankLinesAtStartOfScope, \
|
||||
blankLinesBetweenScopes, \
|
||||
braces, \
|
||||
consecutiveBlankLines, \
|
||||
consecutiveSpaces, \
|
||||
duplicateImports, \
|
||||
elseOnSameLine, \
|
||||
emptyBraces, \
|
||||
fileHeader, \
|
||||
hoistPatternLet, \
|
||||
indent, \
|
||||
initCoderUnavailable, \
|
||||
isEmpty, \
|
||||
leadingDelimiters, \
|
||||
linebreakAtEndOfFile, \
|
||||
linebreaks, \
|
||||
modifierOrder, \
|
||||
numberFormatting, \
|
||||
# organizeDeclarations, \
|
||||
preferKeyPath, \
|
||||
redundantBackticks, \
|
||||
redundantBreak, \
|
||||
redundantExtensionACL, \
|
||||
redundantFileprivate, \
|
||||
redundantGet, \
|
||||
redundantInit, \
|
||||
redundantLet, \
|
||||
redundantLetError, \
|
||||
redundantNilInit, \
|
||||
redundantObjc, \
|
||||
redundantParens, \
|
||||
redundantPattern, \
|
||||
redundantRawValues, \
|
||||
redundantReturn, \
|
||||
redundantSelf, \
|
||||
redundantType, \
|
||||
redundantVoidReturnType, \
|
||||
semicolons, \
|
||||
sortedImports, \
|
||||
spaceAroundBraces, \
|
||||
spaceAroundBrackets, \
|
||||
spaceAroundComments, \
|
||||
spaceAroundGenerics, \
|
||||
spaceAroundOperators, \
|
||||
spaceAroundParens, \
|
||||
spaceInsideBraces, \
|
||||
spaceInsideBrackets, \
|
||||
spaceInsideComments, \
|
||||
spaceInsideGenerics, \
|
||||
spaceInsideParens, \
|
||||
# specifiers, \
|
||||
strongOutlets, \
|
||||
strongifiedSelf, \
|
||||
todos, \
|
||||
trailingClosures, \
|
||||
trailingCommas, \
|
||||
trailingSpace, \
|
||||
typeSugar, \
|
||||
unusedArguments, \
|
||||
void, \
|
||||
wrap, \
|
||||
wrapArguments, \
|
||||
wrapAttributes, \
|
||||
# wrapEnumCases, \
|
||||
# wrapMultilineStatementBraces, \
|
||||
# wrapSwitchCases, \
|
||||
yodaConditions
|
||||
|
||||
## Formatting options
|
||||
|
||||
### Use allman indentation style: "true" or "false" (default)
|
||||
|
||||
## Use allman indentation style: "true" or "false" (default)
|
||||
--allman false
|
||||
## Binary grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
### Binary grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
--binarygrouping 4,8
|
||||
## Closing paren position: "balanced" (default) or "same-line"
|
||||
|
||||
### Closing paren position: "balanced" (default) or "same-line"
|
||||
|
||||
--closingparen balanced
|
||||
## Commas in collection literals: "always" (default) or "inline"
|
||||
|
||||
### Commas in collection literals: "always" (default) or "inline"
|
||||
|
||||
--commas always
|
||||
## Decimal grouping,threshold (default: 3,6) or "none", "ignore"
|
||||
|
||||
### Decimal grouping,threshold (default: 3,6) or "none", "ignore"
|
||||
|
||||
--decimalgrouping 3,6
|
||||
## Placement of else/catch: "same-line" (default) or "next-line"
|
||||
|
||||
### Placement of else/catch: "same-line" (default) or "next-line"
|
||||
|
||||
--elseposition same-line
|
||||
## Case of 'e' in numbers: "lowercase" or "uppercase" (default)
|
||||
|
||||
### Case of 'e' in numbers: "lowercase" or "uppercase" (default)
|
||||
|
||||
--exponentcase lowercase
|
||||
## Group exponent digits: "enabled" or "disabled" (default)
|
||||
|
||||
### Group exponent digits: "enabled" or "disabled" (default)
|
||||
|
||||
--exponentgrouping disabled
|
||||
## Group digits after '.': "enabled" or "disabled" (default)
|
||||
|
||||
### Group digits after '.': "enabled" or "disabled" (default)
|
||||
|
||||
--fractiongrouping disabled
|
||||
## Function @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
### Function @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
--funcattributes prev-line
|
||||
## Guard else: "same-line", "next-line" or "auto" (default)
|
||||
|
||||
### Guard else: "same-line", "next-line" or "auto" (default)
|
||||
|
||||
--guardelse auto
|
||||
## Header comments: "strip", "ignore", or the text you wish use
|
||||
|
||||
### Header comments: "strip", "ignore", or the text you wish use
|
||||
|
||||
--header ignore
|
||||
## Hex grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
### Hex grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
--hexgrouping 4,8
|
||||
## Casing for hex literals: "uppercase" (default) or "lowercase"
|
||||
|
||||
### Casing for hex literals: "uppercase" (default) or "lowercase"
|
||||
|
||||
--hexliteralcase uppercase
|
||||
## #if indenting: "indent" (default), "no-indent" or "outdent"
|
||||
|
||||
### #if indenting: "indent" (default), "no-indent" or "outdent"
|
||||
|
||||
--ifdef indent
|
||||
## "testable-top", "testable-bottom" or "alphabetized" (default)
|
||||
|
||||
### "testable-top", "testable-bottom" or "alphabetized" (default)
|
||||
|
||||
--importgrouping testable-bottom
|
||||
## Number of spaces to indent, or "tab" to use tabs
|
||||
|
||||
### Number of spaces to indent, or "tab" to use tabs
|
||||
|
||||
--indent 4
|
||||
## Indent cases inside a switch: "true" or "false" (default)
|
||||
|
||||
### Indent cases inside a switch: "true" or "false" (default)
|
||||
|
||||
--indentcase false
|
||||
## Linebreak character to use: "cr", "crlf" or "lf" (default)
|
||||
|
||||
### Linebreak character to use: "cr", "crlf" or "lf" (default)
|
||||
|
||||
--linebreaks lf
|
||||
## Maximum length of a line before wrapping. defaults to "none"
|
||||
|
||||
### Maximum length of a line before wrapping. defaults to "none"
|
||||
|
||||
--maxwidth none
|
||||
## Comma-delimited list of modifiers in preferred order
|
||||
|
||||
### Comma-delimited list of modifiers in preferred order
|
||||
|
||||
--modifierorder
|
||||
## Comma-delimited list of operators without surrounding space
|
||||
|
||||
### Comma-delimited list of operators without surrounding space
|
||||
|
||||
--nospaceoperators
|
||||
## Comma-delimited list of operators that shouldn't be wrapped
|
||||
|
||||
### Comma-delimited list of operators that shouldn't be wrapped
|
||||
|
||||
--nowrapoperators
|
||||
## Octal grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
### Octal grouping,threshold (default: 4,8) or "none", "ignore"
|
||||
|
||||
--octalgrouping 4,8
|
||||
## Spacing for operator funcs: "spaced" (default) or "no-space"
|
||||
|
||||
### Spacing for operator funcs: "spaced" (default) or "no-space"
|
||||
|
||||
--operatorfunc spaced
|
||||
## let/var placement in patterns: "hoist" (default) or "inline"
|
||||
|
||||
### let/var placement in patterns: "hoist" (default) or "inline"
|
||||
|
||||
--patternlet hoist
|
||||
## Explicit self: "insert", "remove" (default) or "init-only"
|
||||
|
||||
### Explicit self: "insert", "remove" (default) or "init-only"
|
||||
|
||||
--self init-only
|
||||
## Comma-delimited list of functions with @autoclosure arguments
|
||||
|
||||
### Comma-delimited list of functions with @autoclosure arguments
|
||||
|
||||
--selfrequired
|
||||
## Allow semicolons: "never" or "inline" (default)
|
||||
|
||||
### Allow semicolons: "never" or "inline" (default)
|
||||
|
||||
--semicolons inline
|
||||
## Use ? for Optionals "always" (default) or "except-properties"
|
||||
|
||||
### Use ? for Optionals "always" (default) or "except-properties"
|
||||
|
||||
--shortoptionals always
|
||||
## Align code independently of tab width. defaults to "enabled"
|
||||
|
||||
### Align code independently of tab width. defaults to "enabled"
|
||||
|
||||
--smarttabs enabled
|
||||
## "closure-only", "unnamed-only" or "always" (default)
|
||||
|
||||
### "closure-only", "unnamed-only" or "always" (default)
|
||||
|
||||
--stripunusedargs always
|
||||
## The width of a tab character. Defaults to "unspecified"
|
||||
|
||||
### The width of a tab character. Defaults to "unspecified"
|
||||
|
||||
--tabwidth 4
|
||||
## Comma-delimited list of functions that use trailing closures
|
||||
|
||||
### Comma-delimited list of functions that use trailing closures
|
||||
|
||||
--trailingclosures
|
||||
## Trim trailing space: "always" (default) or "nonblank-lines"
|
||||
|
||||
### Trim trailing space: "always" (default) or "nonblank-lines"
|
||||
|
||||
--trimwhitespace always
|
||||
## Type @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
### Type @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
--typeattributes preserve
|
||||
## Property @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
### Property @attributes: "preserve", "prev-line", or "same-line"
|
||||
|
||||
--varattributes same-line
|
||||
## How Void types are represented: "void" (default) or "tuple"
|
||||
|
||||
### How Void types are represented: "void" (default) or "tuple"
|
||||
|
||||
--voidtype void
|
||||
## Wrap all arguments: "before-first", "after-first", "preserve"
|
||||
|
||||
### Wrap all arguments: "before-first", "after-first", "preserve"
|
||||
|
||||
--wraparguments preserve
|
||||
## Wrap array/dict: "before-first", "after-first", "preserve"
|
||||
|
||||
### Wrap array/dict: "before-first", "after-first", "preserve"
|
||||
|
||||
--wrapcollections preserve
|
||||
## Wrap func params: "before-first", "after-first", "preserve"
|
||||
|
||||
### Wrap func params: "before-first", "after-first", "preserve"
|
||||
|
||||
--wrapparameters preserve
|
||||
## Xcode indent guard/enum: "enabled" or "disabled" (default)
|
||||
|
||||
### Xcode indent guard/enum: "enabled" or "disabled" (default)
|
||||
|
||||
--xcodeindentation disabled
|
||||
## Swap yoda values: "always" (default) or "literals-only"
|
||||
|
||||
### Swap yoda values: "always" (default) or "literals-only"
|
||||
|
||||
--yodaswap always
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
# Folders to exclude from linting
|
||||
# SwiftLint Configuration
|
||||
|
||||
## Folders to exclude from linting
|
||||
|
||||
excluded:
|
||||
- Carthage
|
||||
- go
|
||||
- Pods
|
||||
|
||||
# Active rules
|
||||
## Active rules
|
||||
|
||||
whitelist_rules:
|
||||
- anyobject_protocol
|
||||
- array_init
|
||||
|
|
@ -201,8 +205,9 @@ whitelist_rules:
|
|||
- xctfail_message
|
||||
- yoda_condition
|
||||
|
||||
# Configuration for specific rules
|
||||
closure_body_length:
|
||||
## Configuration for specific rules
|
||||
|
||||
closure_body_length:
|
||||
warning: 40
|
||||
error: 60
|
||||
type_name:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue