🛠️

swift-format の Configuration 【仕分け編】

2021/07/06に公開約1,500字

Formatに影響があるもの

  • lineLength
  • indentation
  • tabWidth
  • maximumBlankLines
  • respectsExistingLineBreaks
  • lineBreakBeforeControlFlowKeywords
  • lineBreakBeforeEachArgument
  • lineBreakBeforeEachGenericRequirement
  • prioritizeKeepingFunctionOutputTogether
  • indentConditionalCompilationBlocks
  • lineBreakAroundMultilineExpressionChainComponents
  • indentSwitchCaseLabels
  • fileScopedDeclarationPrivacy
  • rules
    • DoNotUseSemicolons
    • FileScopedDeclarationPrivacy
    • FullyIndirectEnum
    • GroupNumericLiterals
    • NoAccessLevelOnExtensionDeclaration
    • NoCasesWithOnlyFallthrough
    • NoEmptyTrailingClosureParentheses
    • NoLabelsInCasePatterns
    • NoParensAroundConditions
    • NoVoidReturnOnFunctionSignature
    • OneCasePerLine
    • OneVariableDeclarationPerLine
    • OrderedImports
    • ReturnVoidInsteadOfEmptyTuple
    • UseShorthandTypeNames
    • UseSingleLinePropertyGetter
    • UseTripleSlashForDocumentationComments

Lintにのみ影響があるもの

  • rules
    • AllPublicDeclarationsHaveDocumentation
    • AlwaysUseLowerCamelCase
    • AmbiguousTrailingClosureOverload
    • BeginDocumentationCommentWithOneLineSummary
    • DontRepeatTypeInStaticProperties
    • IdentifiersMustBeASCII
    • NeverForceUnwrap
    • NeverUseForceTry
    • NeverUseImplicitlyUnwrappedOptionals
    • NoBlockComments
    • NoLeadingUnderscores
    • OnlyOneTrailingClosureArgument
    • UseLetInEveryBoundCaseVariable
    • UseSynthesizedInitializer
    • ValidateDocumentationComments

参照

Discussion

ログインするとコメントできます