Skip to content

Commit

Permalink
Merge branch 'master' into Feature/synchronize-upstream
Browse files Browse the repository at this point in the history
# Conflicts:
#	PULL_REQUEST_TEMPLATE.md
  • Loading branch information
rakuyoMo committed Jul 15, 2024
2 parents d6986fd + 6b42857 commit 551d584
Show file tree
Hide file tree
Showing 22 changed files with 1,110 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup
description: Setup the airbnb/swift CI Environment
description: Setup the RakuyoKit/swift CI Environment
inputs:
xcode:
description: The version of Xcode to select
Expand Down
19 changes: 1 addition & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,13 @@ on:
branches: [ master ]

jobs:
test-package-plugin-macos-12:
name: Test Package Plugin
runs-on: macos-12
strategy:
fail-fast: false
matrix:
xcode:
- '13.4.1' # Swift 5.6
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Test Package Plugin
run: bundle exec rake lint:swift

test-package-plugin-macos-13:
name: Test Package Plugin
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '14.2' # Swift 5.7
- '14.3' # Swift 5.8
- '15.0' # Swift 5.9
steps:
Expand All @@ -39,7 +22,7 @@ jobs:
with:
xcode: ${{ matrix.xcode }}
- name: Test Package Plugin
run: bundle exec rake lint:swift
run: bundle exec rake swift:lint

unit-tests:
name: Unit Tests
Expand Down
3 changes: 0 additions & 3 deletions CODE_OF_CONDUCT.md

This file was deleted.

35 changes: 0 additions & 35 deletions CONTRIBUTING.md

This file was deleted.

6 changes: 1 addition & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
GEM
specs:

GEM
remote: https://rubygems.org/
specs:
rake (13.0.6)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
rake (~> 13.0.0)!

BUNDLED WITH
2.5.4
2.1.4
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012 Airbnb
Copyright (c) 2012 Airbnb And 2024 Rakuyo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "e394bf350e38cb100b6bc4172834770ede1b7232",
"version" : "1.0.3"
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
}
}
],
Expand Down
104 changes: 53 additions & 51 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
// swift-tools-version: 5.6
// swift-tools-version: 5.8
import PackageDescription

let package = Package(
name: "AirbnbSwift",
platforms: [.macOS(.v10_13)],
products: [
.plugin(name: "FormatSwift", targets: ["FormatSwift"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.3"),
],
targets: [
.plugin(
name: "FormatSwift",
capability: .command(
intent: .custom(
verb: "format",
description: "Formats Swift source files according to the Airbnb Swift Style Guide"),
permissions: [
.writeToPackageDirectory(reason: "Format Swift source files"),
]),
dependencies: [
"AirbnbSwiftFormatTool",
"swiftformat",
"SwiftLintBinary",
]),
name: "RakuyoSwift",
platforms: [.macOS(.v13)],
products: [
.plugin(name: "FormatSwift", targets: ["FormatSwift"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.4.0"),
],
targets: [
.plugin(
name: "FormatSwift",
capability: .command(
intent: .custom(
verb: "format",
description: "Formats Swift source files according to the Rakuyo Swift Style Guide"
),
permissions: [
.writeToPackageDirectory(reason: "Format Swift source files"),
]
),
dependencies: [
"RakuyoSwiftFormatTool",
"SwiftFormat",
"SwiftLintBinary",
]
),

.executableTarget(
name: "AirbnbSwiftFormatTool",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
resources: [
.process("airbnb.swiftformat"),
.process("swiftlint.yml"),
]),
.executableTarget(
name: "RakuyoSwiftFormatTool",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
resources: [
.process("rakuyo.swiftformat"),
.process("swiftlint.yml"),
]
),

.testTarget(
name: "AirbnbSwiftFormatToolTests",
dependencies: ["AirbnbSwiftFormatTool"]),
.testTarget(
name: "RakuyoSwiftFormatToolTests",
dependencies: ["RakuyoSwiftFormatTool"]
),

.binaryTarget(
name: "swiftformat",
url: "https://github.com/calda/SwiftFormat/releases/download/0.55-beta-2/SwiftFormat.artifactbundle.zip",
checksum: "f7ba281b879af7920e368144117269ba00abcc589b6d36f47ea0c21e62410a7c"),
.binaryTarget(
name: "SwiftFormat",
url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.54.0/SwiftFormat.artifactbundle.zip",
checksum: "edf4ed2f1664ad621ae71031ff915e0c6ef80ad66e87ea0e5a10c3580a27a6dd"
),

.binaryTarget(
name: "SwiftLintBinary",
url: "https://github.com/realm/SwiftLint/releases/download/0.55.1/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "722a705de1cf4e0e07f2b7d2f9f631f3a8b2635a0c84cce99f9677b38aa4a1d6"),
])

// Emit an error on Linux, so Swift Package Manager's platform support detection doesn't say this package supports Linux
// https://github.com/airbnb/swift/discussions/197#discussioncomment-4055303
#if os(Linux)
#error("Linux is currently not supported")
#endif
.binaryTarget(
name: "SwiftLintBinary",
url: "https://github.com/realm/SwiftLint/releases/download/0.55.1/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "722a705de1cf4e0e07f2b7d2f9f631f3a8b2635a0c84cce99f9677b38aa4a1d6"
),
]
)
4 changes: 2 additions & 2 deletions Plugins/FormatSwift/CommandContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import XcodeProjectPlugin

/// Shared methods implemented by `PluginContext` and `XcodePluginContext`
protocol CommandContext {
var pluginWorkDirectory: Path { get }
func tool(named name: String) throws -> PluginContext.Tool
var pluginWorkDirectory: Path { get }
func tool(named name: String) throws -> PluginContext.Tool
}

// MARK: - PluginContext + CommandContext
Expand Down
Loading

0 comments on commit 551d584

Please sign in to comment.