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

Aesthetics for new Swift command plugin #172

Merged
merged 6 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let package = Package(
platforms: [.macOS(.v10_13)],
products: [
.executable(name: "AirbnbSwiftFormatTool", targets: ["AirbnbSwiftFormatTool"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered if we should export this tool or simplify export the plugin for now. I also wondered if we should simplify the name of the tool but I left it as-is.

.plugin(name: "AirbnbSwiftFormatPlugin", targets: ["AirbnbSwiftFormatPlugin"]),
.plugin(name: "FormatSwift", targets: ["FormatSwift"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xcode makes clear that this plugin is from our package, so we can have a simpler name.
Screen Shot 2022-07-21 at 12 13 06 PM

],
dependencies: [
.package(url: "https://github.com/calda/SwiftFormat", exact: "0.49.11-beta-2"),
Expand All @@ -18,7 +18,7 @@ let package = Package(
],
targets: [
.plugin(
name: "AirbnbSwiftFormatPlugin",
name: "FormatSwift",
capability: .command(
intent: .custom(
verb: "format",
Expand All @@ -30,14 +30,12 @@ let package = Package(
"AirbnbSwiftFormatTool",
.product(name: "swiftformat", package: "SwiftFormat"),
.product(name: "swiftlint", package: "SwiftLint"),
],
path: "AirbnbSwiftFormatPlugin"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this path by putting the source in a folder under the default Plugins directory.

]),
.executableTarget(
name: "AirbnbSwiftFormatTool",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "AirbnbSwiftFormatTool",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this path by putting the source in a folder under the default Sources directory.

resources: [
.process("airbnb.swiftformat"),
.process("swiftlint.yml"),
Expand Down