nicklockwood / SwiftFormat

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

Fix SwiftFormat SwiftPM plugin not taking into account the local dependencies of targets #1572

Closed MahdiBM closed 8 months ago

MahdiBM commented 8 months ago

Xcode in plugins will always pass --target and it will only pass the products. When SwiftFormat's package plugin extracts those, it'll only perform the formatting for those targets which are the products, and it'll ignore the local dependencies of those product targets. This makes it so the plugin doesn't format any other targets other than products, which is less than optimal.

This PR will change it so SwiftFormat plugin will also run on local dependencies of the targets passed to the plugin.

This will also match the the code i've written for swift-openapi-generator package plugin.

MahdiBM commented 8 months ago

Forgot to mention, but about deleting the Xcode plugin file: I don't think doing this is possible with the Xcode Plugin version (the same reason why the openapi plugin doesn't have that)

codecov[bot] commented 8 months ago

Codecov Report

Merging #1572 (a538465) into main (8dc0e85) will decrease coverage by 0.03%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1572      +/-   ##
==========================================
- Coverage   95.19%   95.17%   -0.03%     
==========================================
  Files          17       17              
  Lines       20605    20605              
==========================================
- Hits        19615    19610       -5     
- Misses        990      995       +5     

see 1 file with indirect coverage changes

nicklockwood commented 8 months ago

Thanks!