.swiftformat 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Language version.
  2. --swiftversion 5.6
  3. # Ignore generated files.
  4. --exclude **/LinuxMain.swift,**/XCTestManifests.swift,**/*.grpc.swift,**/*.pb.swift
  5. --exclude Sources/GRPCSampleData/GRPCSwiftCertificate.swift
  6. --indent 2
  7. --maxwidth 100
  8. # Require explicit self
  9. --self insert
  10. # Only remove unused args in closures.
  11. --stripunusedargs closure-only
  12. # Wrap before the first argument (if wrapping is necessary).
  13. --wraparguments before-first
  14. # Don't indent #if blocks
  15. --ifdef no-indent
  16. # Don't turn Optional<Foo> into Foo?
  17. --shortoptionals except-properties
  18. # This rule doesn't always work as we'd expect: specifically when we return a
  19. # succeeded future whose type is a closure then that closure is incorrectly
  20. # treated as a trailing closure. This is relevant because the service provider
  21. # API for client streaming RPCs has this exact shape.
  22. --disable trailingClosures
  23. # Don't wrap the opening brace of multiline statements.
  24. --disable wrapMultilineStatementBraces
  25. # We used to support 5.0 and return is redundant in more places in 5.1: enabling
  26. # this rule creates a large (and unnecessary) diff.
  27. --disable redundantReturn
  28. # Don't prefer using key paths for trivial closures.
  29. --disable preferKeyPath
  30. # Put ACLs on declarations within an extension rather than the extension itself.
  31. --extensionacl on-declarations