Skip to content

Commit 69ed9eb

Browse files
authored
Merge pull request #230 from shiguredo/feature/switch-to-swift-format
フォーマッターを swift-format に移行する
2 parents 6a6bf12 + 054bf70 commit 69ed9eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1324
-949
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
CODE_SIGNING_REQUIRED=NO \
5353
CODE_SIGN_IDENTITY= \
5454
PROVISIONING_PROFILE=
55-
- name: Check uncommitted unformatted code
55+
- name: Lint
5656
run: |
5757
./lint-format.sh
5858
slack_notify_succeeded:

.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+
}

CHANGES.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@
1717
- Configration.role に .sendrecv を指定している場合に multistream を true に更新する処理を削除
1818
- Configration.spotlightEnabled に .enabled を指定している場合に multistream を true に更新する処理を削除
1919
- 結果、connect メッセージには Configration.multistreamEnabled に指定した値が送信される
20-
- 今後は Configration.role に .sendrecv を指定している場合または Configration.spotlightEnabled に .enabled を指定している場合に Confgration.multistreamEnabled に false を指定すると接続エラーになる
20+
- 今後は Configration.role に .sendrecv を指定している場合または Configration.spotlightEnabled に .enabled を指定している場合に Confgration.multistreamEnabled に false を指定すると接続エラーになる
2121
- @zztkm
2222
- [UPDATE] multistreamEnabled を非推奨扱いにする
2323
- multistreamEnabled の設定が不要なイニシャライザを `Configuration` に追加する
2424
- ドキュメントコメントに非推奨扱いの旨を追加する
2525
- @zztkm
2626

27+
### misc
28+
29+
- [CHANGE] フォーマッターを swift-format に移行する
30+
- @zztkm
31+
- [UPDATE] GitHub Actions で format check をするのをやめる
32+
- @zztkm
33+
2734
## 2025.1.1
2835

2936
**リリース日**: 2025-01-23

Podfile.dev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ target 'Sora' do
77
use_frameworks!
88
pod 'WebRTC', '132.6834.5.3'
99
pod 'SwiftLint', '0.51.0'
10-
pod 'SwiftFormat/CLI', '0.53.2'
1110
end

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)