Skip to content
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

StringCatalog対応やSwinftLint修正など #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

KaitoMuraoka
Copy link
Member

Close #8
Close #6

対応した内容

  • StringCatalogs の対応:主に日本語のみなので、key も日本語に対応しました
  • gitignote を最新版に対応しました
  • SwiftLint の Warning を対応
  • 一部、Swift Concurrency対応

Note

  • gitignote が iOS の場合、これで良いのか不安なので、確認お願いします

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新の https://github.com/github/gitignore/blob/main/Swift.gitignore を参考にしつつ、Swift Package Manager、CocoaPods、Carthage、fastlane のいずれも、コメントアウトだけでなくて記述自体を削除してしまって良いかなと思います

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct から enum に変更して、うっかり Strings 等のインスタンスが internal から作られないようにしませんか?

namespace 的な使い方をしたいということだと思うので

}
do {
let (data, _) = try await URLSession.shared.data(from: url)
let markdownString = String(decoding: data, as: UTF8.self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちら、今まで使っていた init(data:encoding:) から init(decoding:as:) を使うように変更されていますが、意図した変更ですか?

Comment on lines +49 to +50
// TaskGroupを使用して並列処理する
await withTaskGroup(of: Void.self) { group in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

将来的に、PostListViewModel.sortedPosts で sort せずとも withTaskGroup(of:returning:isolation:body:) の戻り値が sort 済みである状態にしたいですね

do {
let (data, _) = try await URLSession.shared.data(from: url)
let markdownString = String(decoding: data, as: UTF8.self)
guard markdownString.starts(with: " ") else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もし guard を使い続ける場合、https://docs.swift.org/swift-book/documentation/the-swift-programming-language/statements/ と照らし合わせて、else 句のところには処理の脱出を強制させるべきであることを示してそのための処理を書く方が良いと思うので、!markdownString.starts(with: " ") にして else 句では return だけ行いたいです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gitignoreの修正 ベタ書きな文字列をStrings Catalogに記入する
2 participants