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

Adding support for Package Manager Extensible Build Tools (SE-0303). #3679

Closed
alexmodrono opened this issue Jul 16, 2021 · 2 comments
Closed
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@alexmodrono
Copy link

alexmodrono commented Jul 16, 2021

While SwiftLint works correctly when working on a normal Xcode project that allows adding run scripts, working on a package for the Swift Package Manager is a whole other can of worms. Since there is no possible way for adding custom run scripts to swift packages, there is no possible customization.

To this problem, Apple has released SE-0303 which introduces a new SwiftPM target type called plugin, which basically are Swift targets that use specialized API in a new PackagePlugin library that is provided by SwiftPM, to configure commands that will run during the build.

I believe this was already introduced in Swift 5.5 most recent beta. It would be really nice to have these new features implemented in SwiftLint so that we can also see syntax corrections on Swift packages.

Thanks!

@amomchilov
Copy link

amomchilov commented Feb 13, 2022

The build tool plugins introduced in SE-0303 won't work here (at least, not if we want to support --fix), as explained in SE-0332:

The build tool plugins that were introduced in SE-0303 are focused on code generation during the build of a package, for such purposes as generating Swift source files from .proto files or from other inputs. In order to allow build tools to be incorporated into the build graph and to run automatically in a safe manner, there are restrictions on what such plugins can do. For example, build tool plugins are prevented from modifying any files inside a package directory.

What we'll want is a PackageModel.PluginCommandIntent.sourceCodeFormatting as was introduced in SE-0332. Though it looks like the these plugins can't be run automatically during a build, and Xcode doesn't expose any UI for them yet.

@SimplyDanny SimplyDanny added the enhancement Ideas for improvements of existing features and rules. label May 1, 2022
@jpsim
Copy link
Collaborator

jpsim commented Oct 5, 2022

Done in 3fd1573

@jpsim jpsim closed this as completed Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

4 participants