Skip to content

Commit 6d08214

Browse files
committed
swift-format によるフォーマット
1 parent 6a6bf12 commit 6d08214

37 files changed

+1310
-940
lines changed

.swift-format

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"spacesBeforeEndOfLineComments": 1,
6+
"indentConditionalCompilationBlocks" : true,
7+
"indentSwitchCaseLabels" : false,
8+
"indentation" : {
9+
"spaces" : 4
10+
},
11+
"lineBreakAroundMultilineExpressionChainComponents" : false,
12+
"lineBreakBeforeControlFlowKeywords" : false,
13+
"lineBreakBeforeEachArgument" : false,
14+
"lineBreakBeforeEachGenericRequirement" : false,
15+
"lineLength" : 100,
16+
"maximumBlankLines" : 1,
17+
"multiElementCollectionTrailingCommas" : true,
18+
"noAssignmentInExpressions" : {
19+
"allowedFunctions" : [
20+
"XCTAssertNoThrow"
21+
]
22+
},
23+
"prioritizeKeepingFunctionOutputTogether" : false,
24+
"respectsExistingLineBreaks" : true,
25+
"rules" : {
26+
"AllPublicDeclarationsHaveDocumentation" : false,
27+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
28+
"AlwaysUseLowerCamelCase" : true,
29+
"AmbiguousTrailingClosureOverload" : true,
30+
"BeginDocumentationCommentWithOneLineSummary" : false,
31+
"DoNotUseSemicolons" : true,
32+
"DontRepeatTypeInStaticProperties" : true,
33+
"FileScopedDeclarationPrivacy" : true,
34+
"FullyIndirectEnum" : true,
35+
"GroupNumericLiterals" : true,
36+
"IdentifiersMustBeASCII" : true,
37+
"NeverForceUnwrap" : false,
38+
"NeverUseForceTry" : false,
39+
"NeverUseImplicitlyUnwrappedOptionals" : false,
40+
"NoAccessLevelOnExtensionDeclaration" : true,
41+
"NoAssignmentInExpressions" : true,
42+
"NoBlockComments" : true,
43+
"NoCasesWithOnlyFallthrough" : true,
44+
"NoEmptyTrailingClosureParentheses" : true,
45+
"NoLabelsInCasePatterns" : true,
46+
"NoLeadingUnderscores" : false,
47+
"NoParensAroundConditions" : true,
48+
"NoPlaygroundLiterals" : true,
49+
"NoVoidReturnOnFunctionSignature" : true,
50+
"OmitExplicitReturns" : false,
51+
"OneCasePerLine" : true,
52+
"OneVariableDeclarationPerLine" : true,
53+
"OnlyOneTrailingClosureArgument" : true,
54+
"OrderedImports" : true,
55+
"ReplaceForEachWithForLoop" : true,
56+
"ReturnVoidInsteadOfEmptyTuple" : true,
57+
"TypeNamesShouldBeCapitalized" : true,
58+
"UseEarlyExits" : false,
59+
"UseExplicitNilCheckInConditions" : true,
60+
"UseLetInEveryBoundCaseVariable" : true,
61+
"UseShorthandTypeNames" : true,
62+
"UseSingleLinePropertyGetter" : true,
63+
"UseSynthesizedInitializer" : true,
64+
"UseTripleSlashForDocumentationComments" : true,
65+
"UseWhereClausesInForLoops" : false,
66+
"ValidateDocumentationComments" : false
67+
},
68+
"spacesAroundRangeFormationOperators" : false,
69+
"tabWidth" : 8,
70+
"version" : 1
71+
}

Sora/AspectRatio.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import UIKit
22

33
/// :nodoc:
44
public enum AspectRatio {
5-
case standard // 4:3
6-
case wide // 16:9
5+
case standard // 4:3
6+
case wide // 16:9
77

88
public func height(forWidth width: CGFloat) -> CGFloat {
99
switch self {
@@ -24,9 +24,12 @@ public enum AspectRatio {
2424
}
2525

2626
private var aspectRatioTable: PairTable<String, AspectRatio> =
27-
PairTable(name: "AspectRatio",
28-
pairs: [("standard", .standard),
29-
("wide", .wide)])
27+
PairTable(
28+
name: "AspectRatio",
29+
pairs: [
30+
("standard", .standard),
31+
("wide", .wide),
32+
])
3033

3134
/// :nodoc:
3235
extension AspectRatio: Codable {

Sora/AudioCodec.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import Foundation
22

33
private let descriptionTable: PairTable<String, AudioCodec> =
4-
PairTable(name: "AudioCodec",
5-
pairs: [("default", .default),
6-
("OPUS", .opus),
7-
("PCMU", .pcmu)])
4+
PairTable(
5+
name: "AudioCodec",
6+
pairs: [
7+
("default", .default),
8+
("OPUS", .opus),
9+
("PCMU", .pcmu),
10+
])
811

9-
/**
10-
音声コーデックを表します。
11-
*/
12+
/// 音声コーデックを表します。
1213
public enum AudioCodec {
1314
/**
1415
サーバーが指定するデフォルトのコーデック。

Sora/AudioMode.swift

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import AVFoundation
22
import Foundation
33

4-
/**
5-
* 音声モード。
6-
* ``AVAudioSession`` の音声モードと音声カテゴリを変更します。
7-
* 詳細な設定を行いたい場合は ``AVAudioSession`` を使用して下さい。
8-
*
9-
* 音声カテゴリのオプションは次の値が指定されます:
10-
*
11-
* - ``allowBluetooth``
12-
* - ``allowBluetoothA2DP``
13-
* - ``allowAirPlay``
14-
*
15-
*/
4+
/// 音声モード。
5+
/// ``AVAudioSession`` の音声モードと音声カテゴリを変更します。
6+
/// 詳細な設定を行いたい場合は ``AVAudioSession`` を使用して下さい。
7+
///
8+
/// 音声カテゴリのオプションは次の値が指定されます:
9+
///
10+
/// - ``allowBluetooth``
11+
/// - ``allowBluetoothA2DP``
12+
/// - ``allowAirPlay``
1613
public enum AudioMode {
1714
/**
1815
* デフォルト。
@@ -44,9 +41,7 @@ public enum AudioMode {
4441
case voiceChat(output: AudioOutput)
4542
}
4643

47-
/**
48-
* 音声出力先
49-
*/
44+
/// 音声出力先
5045
public enum AudioOutput {
5146
/// デフォルト。端末の状態に依存します。
5247
case `default`

0 commit comments

Comments
 (0)