nicklockwood / SwiftFormat

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

Feature idea: detect swift version automatically from Package.swift #1496

Open nicklockwood opened 1 year ago

nicklockwood commented 1 year ago

If SwiftFormat detects a Package.swift file it could use it to automatically infer the --swiftversion from the // swift-tools-version: comment, and/or generate a warning if the versions don't match.

jshier commented 1 year ago

You would also have to consider the existence of all other Package@swift-5.x files as well to determine the true minimum supported Swift version.