-
Notifications
You must be signed in to change notification settings - Fork 10
CI に Format Lint を追加する & Format Lint の警告に対応 #237
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
Conversation
| - name: Lint | ||
| run: | | ||
| ./lint-format.sh | ||
| make lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
| - [UPDATE] GitHub Actions で format check をするのをやめる | ||
| - @zztkm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 format check は一時的にはやめたけど今回戻したのでこの CHANGES は混乱を生みそうな気がした。
結果的に SwiftFormat から swift-format に format lint も移行しただけなので消しておいて良いかもしれない。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format lint と lint を GitHub Actions で実行する箇所とローカルでの lint 実行は Makefile に譲ったので、lint-format.sh は不要になった。今までありがとう。
| // 採用された WebSocket 以外を切断してから webSocketChannelCandidates をクリアする | ||
| weakSelf.webSocketChannelCandidates.removeAll { $0 == webSocketChannel } | ||
| weakSelf.webSocketChannelCandidates.forEach { | ||
| for candidate in weakSelf.webSocketChannelCandidates { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forEach ではなく、for in が推奨されていたので対応(他の forEach を使っている箇所も同様。
|
|
||
| switch signaling { | ||
| case var .offer(message): | ||
| case .offer(var message): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let と同様、var も () 内に定義する(警告文では let と表記されるけど...)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
フォーマッターに従う方針で良いと思います。
| // swift-format-ignore: AlwaysUseLowerCamelCase | ||
| // JSON のキー名に合わせるためにスネークケースを使用しているので、ignore する |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGES にも記載したが、JSON デコード処理に使う JSON のキー名を指定するための enum の定義については、AlwaysUseLowerCamelCase ルールを無効化するためのコメントを追加。
Signaling.swift 内に数か所同じコメントがある。
torikizi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM です。修正ありがとうございました。
SwiftFormat から swift-format へ移行する対応で、
swift format lintによるスタイルチェックを有効化し、すべての警告を修正しました。AlwaysUseLowerCamelCaseルールを無効化するためのコメントを追加This pull request includes several changes to improve the codebase by updating documentation comments and modifying the build and lint process. The most important changes include updating the GitHub Actions workflow to use a Makefile for linting, transitioning documentation comments from block comments to line comments, and simplifying switch case syntax.
Build and Lint Process Updates:
.github/workflows/build.yml: Added a new step for format linting and updated the linting step to usemake lintinstead of./lint-format.sh.CHANGES.md: Documented the transition to using a Makefile for linting in GitHub Actions, including the removal oflint-format.sh. [1] [2]Documentation Comment Updates:
Sora/CameraVideoCapturer.swift: Updated multiple documentation comments from block comments to line comments for methods and properties. [1] [2] [3] [4] [5]Sora/Configuration.swift: Updated documentation comments from block comments to line comments for initializers and properties. [1] [2] [3] [4] [5] [6] [7]Sora/ICECandidate.swift: Updated documentation comments from block comments to line comments for methods and properties. [1] [2]Sora/MediaChannel.swift: Updated documentation comments from block comments to line comments for methods and properties. [1] [2] [3] [4] [5] [6] [7]Sora/MediaStream.swift: Updated documentation comments from block comments to line comments for methods and properties. [1] [2]Code Simplification:
Sora/ConnectionTimer.swift: Simplified switch case syntax by moving theletkeyword inside the case pattern.Sora/DataChannel.swift: Simplified switch case syntax by moving theletkeyword inside the case pattern.Sora/Logger.swift: Simplified switch case syntax by moving theletkeyword inside the case pattern.