-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3794f3d
commit f1db357
Showing
63 changed files
with
609 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# ============= | ||
# == Options == | ||
# ============= | ||
|
||
# Use 'swiftformat --options' to list all of the possible options | ||
# For most of the options we use default value (except for '--self') | ||
|
||
--allman false | ||
--commas always | ||
--elseposition same-line # I hate it, but this is 'community choice' in Swift | ||
--empty void | ||
--header ignore # We don't have a header. Headers are ugly. | ||
--ifdef indent | ||
--indent 2 | ||
--indentcase false | ||
--linebreaks lf | ||
--maxwidth none # 80 is preferred (but not required), don't go over 100 | ||
--nospaceoperators ..<, ... | ||
--operatorfunc spaced | ||
--self insert # Yes! | ||
--selfrequired | ||
--semicolons inline | ||
--stripunusedargs closure-only | ||
--tabwidth unspecified # Don't use tabs! | ||
--trailingclosures | ||
--trimwhitespace always | ||
--xcodeindentation disabled | ||
|
||
# Arguments are | ||
# - group - group size (count % group == 0) | ||
# - threshold - min digit count to apply (number.count >= threshold) | ||
--decimalgrouping 3,1 | ||
--binarygrouping 4,1 | ||
--octalgrouping 4,1 | ||
--hexgrouping 4,1 | ||
--exponentcase lowercase | ||
--exponentgrouping enabled | ||
--fractiongrouping enabled | ||
--hexliteralcase lowercase | ||
|
||
--wraparguments preserve | ||
--wrapcollections preserve | ||
--wrapparameters preserve | ||
--closingparen balanced | ||
|
||
# We have our own (see: './Scipts/sort_swift_imports') | ||
# But it is not required to follow it. | ||
--importgrouping alphabetized | ||
|
||
# Our own rule: all patterns should start at the same column, | ||
# otherwise reader has to 'zig-zag' to read which pattern is bound where. | ||
# (in other words: if all patterns have binding -> hoist, otherwise per variable) | ||
# | ||
# For example, this is not allowed (or at least frowned upon): | ||
# switch frozen { | ||
# case .elsa | ||
# case let .anna(x) <-- nope, both 'elsa' and 'anna' should start the same column | ||
# } | ||
--patternlet hoist | ||
|
||
# =========== | ||
# == Rules == | ||
# =========== | ||
|
||
--disable andOperator # Use '&&' ot ',' wherever you want | ||
--enable anyObjectProtocol | ||
--enable blankLinesAroundMark | ||
--enable blankLinesAtEndOfScope | ||
--disable blankLinesAtStartOfScope # Empty line after 'class' definition | ||
--enable blankLinesBetweenScopes | ||
--enable braces | ||
--enable consecutiveBlankLines | ||
--enable consecutiveSpaces | ||
--enable duplicateImports | ||
--enable elseOnSameLine | ||
--enable emptyBraces | ||
--enable fileHeader | ||
--disable hoistPatternLet | ||
--disable indent # This breaks a lof of already written stuff. | ||
--disable isEmpty # False-positives | ||
--enable leadingDelimiters | ||
--enable linebreakAtEndOfFile | ||
--enable linebreaks | ||
--enable numberFormatting | ||
# --enable ranges - deprecated | ||
--enable redundantBackticks | ||
--enable redundantBreak | ||
--enable redundantExtensionACL | ||
--enable redundantFileprivate | ||
--enable redundantGet | ||
--enable redundantInit | ||
--enable redundantLet | ||
--enable redundantLetError | ||
--enable redundantNilInit | ||
--enable redundantObjc | ||
--enable redundantParens | ||
--enable redundantPattern | ||
--disable redundantRawValues # It is 'ok' to specify raw value (even if it is the same as value) | ||
--disable redundantReturn # implicit = bad | ||
--enable redundantSelf | ||
--enable redundantVoidReturnType | ||
--enable semicolons | ||
--disable sortedImports | ||
--enable spaceAroundBraces | ||
--enable spaceAroundBrackets | ||
--enable spaceAroundComments | ||
--enable spaceAroundGenerics | ||
--enable spaceAroundOperators | ||
--enable spaceAroundParens | ||
--enable spaceInsideBraces | ||
--enable spaceInsideBrackets | ||
--enable spaceInsideComments | ||
--enable spaceInsideGenerics | ||
--enable spaceInsideParens | ||
--disable specifiers # Conflict with SwiftLint | ||
--enable strongOutlets | ||
--enable strongifiedSelf | ||
--enable todos | ||
--enable trailingClosures | ||
--disable trailingCommas # | ||
--enable trailingSpace | ||
--enable typeSugar | ||
--enable unusedArguments | ||
--enable void | ||
--disable wrap # Breaks already written code | ||
--disable wrapArguments # See above | ||
--disable yodaConditions # '0 < x && x < 10' is better than ' x > 0 && x < 10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.