DroidKaigi / conference-app-2023

The Official Conference App for DroidKaigi 2023
Apache License 2.0
645 stars 206 forks source link

[iOS] Introduce swift-format #393

Open tkhs0604 opened 1 year ago

tkhs0604 commented 1 year ago

What to do

We would like to introduce swift-format in order to decrease indents from 4 to 2.

Design

N/A

KaitoMuraoka commented 1 year ago

I would love to try. 🙋

RyuNen344 commented 1 year ago

Thx!! Assigned!!

KaitoMuraoka commented 1 year ago

I encountered the following error:

Failed to resolve dependencies Dependencies could not be resolved because root depends on 'swiftlint' 0.52.4..<1.0.0 and root depends on 'swift-format' 508.0.0..<509.0.0.
'swiftlint' is incompatible with 'swift-format'.
'swiftlint' >= 0.52.4 practically depends on 'swift-syntax' 509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-07-04-a because 'swiftlint' 0.52.4 depends on 'swift-syntax' 509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-07-04-a and no versions of 'swiftlint' match the requirement 0.52.5..<1.0.0.
'swift-format' >= 508.0.0 practically depends on 'swift-syntax' 508.0.0..<509.0.0 because 'swift-format' 508.0.0 depends on 'swift-syntax' 508.0.0..<509.0.0 and 'swift-format' 508.0.1 depends on 'swift-syntax' 508.0.0..<509.0.0.
'swift-format' {508.0.0, 508.0.2..<509.0.0} practically depends on 'swift-syntax' 508.0.0..<509.0.0 because no versions of 'swift-format' match the requirement 508.0.2..<509.0.0 and 'swift-format' 508.0.0 depends on 'swift-syntax' 508.0.0..<509.0.0.

From this, I believe that in order to match the version of SwiftSyntax, you either need to upgrade the version of swift-format or downgrade the version of SwiftLint. However, the current latest version of swift-format is 508.0.1, and it cannot be upgraded any further. Therefore, I think the only option is to downgrade the version of SwiftLint and swift-syntax. What do you think?

日本語 以下のようなエラーが発生します。 ```shell Failed to resolve dependencies Dependencies could not be resolved because root depends on 'swiftlint' 0.52.4..<1.0.0 and root depends on 'swift-format' 508.0.0..<509.0.0. 'swiftlint' is incompatible with 'swift-format'. 'swiftlint' >= 0.52.4 practically depends on 'swift-syntax' 509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-07-04-a because 'swiftlint' 0.52.4 depends on 'swift-syntax' 509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-07-04-a and no versions of 'swiftlint' match the requirement 0.52.5..<1.0.0. 'swift-format' >= 508.0.0 practically depends on 'swift-syntax' 508.0.0..<509.0.0 because 'swift-format' 508.0.0 depends on 'swift-syntax' 508.0.0..<509.0.0 and 'swift-format' 508.0.1 depends on 'swift-syntax' 508.0.0..<509.0.0. 'swift-format' {508.0.0, 508.0.2..<509.0.0} practically depends on 'swift-syntax' 508.0.0..<509.0.0 because no versions of 'swift-format' match the requirement 508.0.2..<509.0.0 and 'swift-format' 508.0.0 depends on 'swift-syntax' 508.0.0..<509.0.0. ``` このことから、swift-format のバージョンを上げるか、SwiftLintのバージョンを下げないと、SwiftSyntac のバージョンに合わせることができないと思います。 しかし、swift-format の現在の最新バージョンは 508.0.1 でこれ以上上げることができないので、SwiftLintとswift-syntaxのバージョンを下げるしか方法がないと思うのですが、どうすれば良いでしょうか?