Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struct protocols indentation #1945

Open
Nonouf opened this issue Dec 10, 2024 · 1 comment
Open

Struct protocols indentation #1945

Nonouf opened this issue Dec 10, 2024 · 1 comment

Comments

@Nonouf
Copy link

Nonouf commented Dec 10, 2024

I’d like to keep every protocols implemented by a struct aligned. Xcode indents them like that :

public struct MyStruct: ProtocolA,
                        ProtocolB,
                        ProtocolC {

When I run SwiftFormat, it always break the alignment between each protocol. How can I keep them aligned?

public struct MyStruct: ProtocolA,
  ProtocolB,
  ProtocolC {

My .swiftformat file is the following :

.swiftformat
# format options
--swiftversion 5.10.0
--allman false
--indent 2
--typeblanklines remove
--elseposition same-line
--guardelse same-line
--self init-only
--closurevoid remove
--semicolons never
--stripunusedargs closure-only
--wraparguments after-first
--wrapparameters after-first
--wrapcollections before-first
--closingparen same-line
--wrapreturntype preserve
--funcattributes prev-line
--typeattributes prev-line
--storedvarattrs prev-line
--computedvarattrs prev-line
--maxwidth 160
--wrapenumcases always
--lineaftermarks true
--smarttabs enabled
--indentcase false
--ifdef indent
--voidtype void
--linebreaks lf
--xcodeindentation disabled
--operatorfunc spaced
--ranges no-space
--trimwhitespace always
--closingparen balanced
--wrapeffects never
--wrapconditions after-first
--wraptypealiases preserve
--shortoptionals always
--emptybraces no-space
--enumnamespaces always
--extensionacl on-extension
--header ""
--stripunusedargs closure-only
--importgrouping testable-last
--commas inline
--propertytypes explicit

# rules
--enable andOperator
--enable anyObjectProtocol
--enable blankLineAfterImports
--enable blankLinesAroundMark
--enable blankLinesAtEndOfScope
--enable blankLinesAtStartOfScope
--enable blankLinesBetweenScopes
--enable braces
--enable conditionalAssignment
--enable consecutiveBlankLines
--enable consecutiveSpaces
--enable docCommentsBeforeModifiers
--enable duplicateImports
--enable elseOnSameLine
--enable emptyBraces
--enable enumNamespaces
--enable extensionAccessControl
--enable hoistAwait
--enable initCoderUnavailable
--enable isEmpty
--enable leadingDelimiters
--enable linebreaks
--enable modifierOrder
--enable redundantBackticks
--enable redundantBreak
--enable redundantExtensionACL
--enable redundantFileprivate
--enable redundantGet
--enable redundantInit
--enable redundantInternal
--enable redundantLet
--enable redundantLetError
--enable redundantNilInit
--enable redundantObjc
--enable redundantOptionalBinding
--enable redundantParens
--enable redundantPattern
--enable redundantProperty
--enable redundantRawValues
--enable redundantReturn
--enable redundantSelf
--enable redundantVoidReturnType
--enable redundantTypedThrows
--enable semicolons
--enable spaceAroundBraces
--enable spaceAroundBrackets
--enable spaceAroundComments
--enable spaceAroundGenerics
--enable spaceAroundOperators
--enable spaceAroundParens
--enable spaceInsideBraces
--enable spaceInsideBrackets
--enable spaceInsideComments
--enable spaceInsideGenerics
--enable spaceInsideParens
--enable todos
--enable trailingClosures
--enable trailingSpace
--enable typeSugar
--enable unusedArguments
--enable wrapArguments
--enable wrapAttributes
--enable wrapConditionalBodies
--enable wrapEnumCases
--enable indent
--enable fileHeader
--enable void
--enable yodaConditions
--enable unusedPrivateDeclarations
--enable unusedArguments
--enable trailingCommas
--enable sortImports
--enable redundantType
--enable redundantStaticSelf
--enable docComments
--enable blankLinesBetweenImports
--enable blankLinesBetweenChainedFunctions
--enable acronyms
--disable blockComments
--disable genericExtensions
--disable hoistPatternLet
--disable hoistTry
--disable linebreakAtEndOfFile
--disable markTypes
--disable numberFormatting
--disable opaqueGenericParameters
--disable organizeDeclarations
--disable preferKeyPath
--disable redundantClosure
--disable sortDeclarations
--disable sortSwitchCases
--disable strongOutlets
--disable strongifiedSelf
--disable wrapMultilineStatementBraces
--disable wrapSingleLineComments
--disable wrap
--disable wrapSwitchCases
--disable preferForLoop

I’ve tried to enable xcodeindentation or disable smartabs but it doesn’t change anything.

@nicklockwood
Copy link
Owner

This isn't currently supported (but should be)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants