nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.92k stars 639 forks source link

Name clash with Apples' swift-format #1488

Open hitshydev opened 1 year ago

hitshydev commented 1 year ago

I was using SwiftFormat in a project and wanted to add the new swift-openapi-generator package. Since that package uses the apple swift-format package the package resolution step fails. We've disabled the Linter Plugin for now and use the CLI and IDE tools. To you have any ideas/plans to resolve this issue? Thanks in advance!

nicklockwood commented 1 year ago

I'm not sure what a good solution for this is in the long term, but your best option is probably to fork SwiftFormat and rename the package to SwiftFormat2 or something.

I appreciate this isn't ideal. If this comes up more often I might consider maintaining such a fork myself.

calda commented 1 year ago

I think SPM module aliasing is designed to be the solution for this type of problem: https://github.com/apple/swift-evolution/blob/main/proposals/0339-module-aliasing-for-disambiguation.md

hitshydev commented 1 year ago

Thanks for the hint @calda! When I get back the project I'll try to use the module aliasing and keep you updated. I'm curious if it works in a normal XCode project, since there is no Package.swift file or similar.

If I get it to work, maybe a small notice in the readme would help?