Add swift-format configuration
Codifies the project's existing style: 4-space indentation, 120-column lines, ordered imports, one blank line maximum, and private file-scoped declarations. The force-unwrap/IUO/force-try lint rules stay disabled because the binding uses those deliberately (the API bootstrap statics, unsafelyUnwrapped function-pointer calls). Formatting-behavior options mirror the current layout; the main known divergence is continuation-line style, where swift-format's fixed indent differs from the paren-aligned wrapping used in places. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"version": 1,
|
||||
"lineLength": 200,
|
||||
"indentation": {
|
||||
"spaces": 4
|
||||
},
|
||||
"tabWidth": 4,
|
||||
"maximumBlankLines": 1,
|
||||
"respectsExistingLineBreaks": false,
|
||||
"lineBreakBeforeControlFlowKeywords": false,
|
||||
"lineBreakBeforeEachArgument": false,
|
||||
"lineBreakBeforeEachGenericRequirement": false,
|
||||
"lineBreakAroundMultilineExpressionChainComponents": false,
|
||||
"lineBreakBetweenDeclarationAttributes": false,
|
||||
"prioritizeKeepingFunctionOutputTogether": false,
|
||||
"indentConditionalCompilationBlocks": true,
|
||||
"indentSwitchCaseLabels": false,
|
||||
"spacesAroundRangeFormationOperators": false,
|
||||
"multiElementCollectionTrailingCommas": true,
|
||||
"fileScopedDeclarationPrivacy": {
|
||||
"accessLevel": "private"
|
||||
},
|
||||
"rules": {
|
||||
"AllPublicDeclarationsHaveDocumentation": true,
|
||||
"AlwaysUseLiteralForEmptyCollectionInit": false,
|
||||
"AlwaysUseLowerCamelCase": true,
|
||||
"AmbiguousTrailingClosureOverload": true,
|
||||
"BeginDocumentationCommentWithOneLineSummary": true,
|
||||
"DoNotUseSemicolons": true,
|
||||
"DontRepeatTypeInStaticProperties": true,
|
||||
"FileScopedDeclarationPrivacy": true,
|
||||
"FullyIndirectEnum": true,
|
||||
"GroupNumericLiterals": true,
|
||||
"IdentifiersMustBeASCII": true,
|
||||
"NeverForceUnwrap": true,
|
||||
"NeverUseForceTry": true,
|
||||
"NeverUseImplicitlyUnwrappedOptionals": true,
|
||||
"NoAccessLevelOnExtensionDeclaration": true,
|
||||
"NoAssignmentInExpressions": true,
|
||||
"NoBlockComments": true,
|
||||
"NoCasesWithOnlyFallthrough": true,
|
||||
"NoEmptyLinesOpeningClosingBraces": true,
|
||||
"NoEmptyTrailingClosureParentheses": true,
|
||||
"NoLabelsInCasePatterns": true,
|
||||
"NoLeadingUnderscores": true,
|
||||
"NoParensAroundConditions": true,
|
||||
"NoVoidReturnOnFunctionSignature": true,
|
||||
"OmitExplicitReturns": true,
|
||||
"OneCasePerLine": true,
|
||||
"OneVariableDeclarationPerLine": true,
|
||||
"OnlyOneTrailingClosureArgument": true,
|
||||
"OrderedImports": true,
|
||||
"ReplaceForEachWithForLoop": true,
|
||||
"ReturnVoidInsteadOfEmptyTuple": true,
|
||||
"TypeNamesShouldBeCapitalized": true,
|
||||
"UseEarlyExits": true,
|
||||
"UseExplicitNilCheckInConditions": true,
|
||||
"UseLetInEveryBoundCaseVariable": true,
|
||||
"UseShorthandTypeNames": true,
|
||||
"UseSingleLinePropertyGetter": true,
|
||||
"UseSynthesizedInitializer": true,
|
||||
"UseTripleSlashForDocumentationComments": true,
|
||||
"UseWhereClausesInForLoops": false,
|
||||
"ValidateDocumentationComments": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user