This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc | ||
.swiftpm/xcode/xcshareddata/xcschemes/swift-plugins-Package.xcscheme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
SHELL=/bin/bash | ||
|
||
checks: breakage language symlinks deps lint | ||
|
||
breakage: | ||
swift package --disable-sandbox check-api-breakage | ||
|
||
symlinks: | ||
swift package --disable-sandbox check-broken-symlinks | ||
|
||
deps: | ||
swift package --disable-sandbox check-local-swift-dependencies | ||
|
||
security: | ||
swift package --disable-sandbox check-openapi-security | ||
|
||
validation: | ||
swift package --disable-sandbox check-openapi-validation | ||
|
||
language: | ||
swift package --disable-sandbox check-unacceptable-language | ||
|
||
contributors: | ||
swift package --disable-sandbox generate-contributors-list | ||
|
||
install-format: | ||
swift package --disable-sandbox install-swift-format | ||
|
||
install-openapi: | ||
swift package --disable-sandbox install-swift-openapi-generator | ||
|
||
run-clean: | ||
swift package --disable-sandbox run-clean | ||
|
||
server: | ||
swift package --disable-sandbox run-openapi-server | ||
|
||
lint: | ||
swift package --disable-sandbox run-swift-format | ||
|
||
format: | ||
swift package --disable-sandbox run-swift-format --fix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
// swift-tools-version: 5.9 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "swift-plugins", | ||
platforms: [ | ||
.macOS(.v10_15), | ||
], | ||
products: [ | ||
.plugin(name: "CheckApiBreakagePlugin", targets: ["CheckApiBreakagePlugin"]), | ||
.plugin(name: "CheckBrokenSymlinksPlugin", targets: ["CheckBrokenSymlinksPlugin"]), | ||
.plugin(name: "CheckLocalSwiftDependenciesPlugin", targets: ["CheckLocalSwiftDependenciesPlugin"]), | ||
.plugin(name: "CheckOpenApiSecurityPlugin", targets: ["CheckOpenApiSecurityPlugin"]), | ||
.plugin(name: "CheckOpenApiValidationPlugin", targets: ["CheckOpenApiValidationPlugin"]), | ||
.plugin(name: "CheckUnacceptableLanguagePlugin", targets: ["CheckUnacceptableLanguagePlugin"]), | ||
.plugin(name: "GenerateContributorsListPlugin", targets: ["GenerateContributorsListPlugin"]), | ||
.plugin(name: "InstallSwiftFormatPlugin", targets: ["InstallSwiftFormatPlugin"]), | ||
.plugin(name: "InstallSwiftOpenApiGeneratorPlugin", targets: ["InstallSwiftOpenApiGeneratorPlugin"]), | ||
.plugin(name: "RunCleanPlugin", targets: ["RunCleanPlugin"]), | ||
.plugin(name: "RunOpenApiServerPlugin", targets: ["RunOpenApiServerPlugin"]), | ||
.plugin(name: "RunSwiftFormatPlugin", targets: ["RunSwiftFormatPlugin"]), | ||
], | ||
dependencies: [], | ||
targets: [ | ||
.plugin( | ||
name: "CheckApiBreakagePlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-api-breakage", | ||
description: "runs check-api-breakage.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "CheckBrokenSymlinksPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-broken-symlinks", | ||
description: "runs check-broken-symlinks.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "CheckLocalSwiftDependenciesPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-local-swift-dependencies", | ||
description: "runs check-local-swift-dependencies.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "CheckOpenApiSecurityPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-openapi-security", | ||
description: "runs check-openapi-security.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "CheckOpenApiValidationPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-openapi-validation", | ||
description: "runs check-openapi-validation.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "CheckUnacceptableLanguagePlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "check-unacceptable-language", | ||
description: "runs check-unacceptable-language.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "GenerateContributorsListPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "generate-contributors-list", | ||
description: "runs generate-contributors-list.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "InstallSwiftFormatPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "install-swift-format", | ||
description: "runs install-swift-format.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "InstallSwiftOpenApiGeneratorPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "install-swift-openapi-generator", | ||
description: "runs install-swift-openapi-generator.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "RunCleanPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "run-clean", | ||
description: "runs run-clean.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "RunOpenApiServerPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "run-openapi-server", | ||
description: "runs run-openapi-server.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
.plugin( | ||
name: "RunSwiftFormatPlugin", | ||
capability: .command( | ||
intent: .custom( | ||
verb: "run-swift-format", | ||
description: "runs run-swift-format.sh" | ||
) | ||
), | ||
dependencies: [] | ||
), | ||
] | ||
) |
19 changes: 19 additions & 0 deletions
19
Plugins/CheckApiBreakagePlugin/CheckApiBreakagePlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CheckApiBreakagePlugin.swift | ||
// | ||
// Created by gerp83 on 05/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckApiBreakagePlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(CheckApiBreakageScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/CheckBrokenSymlinksPlugin/CheckBrokenSymlinksPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CheckBrokenSymlinksPlugin.swift | ||
// | ||
// Created by gerp83 on 05/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckBrokenSymlinksPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(CheckBrokenSymlinksScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/CheckLocalSwiftDependenciesPlugin/CheckLocalSwiftDependenciesPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CheckLocalSwiftDependenciesPlugin.swift | ||
// | ||
// Created by gerp83 on 05/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckLocalSwiftDependenciesPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(CheckLocalSwiftDependenciesScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/CheckOpenApiSecurityPlugin/CheckOpenApiSecurityPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CheckOpenApiSecurityPlugin.swift | ||
// | ||
// Created by gerp83 on 07/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckOpenApiSecurityPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(CheckOpenApiSecurityScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/CheckOpenApiValidationPlugin/CheckOpenApiValidationPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CheckOpenApiValidationPlugin.swift | ||
// | ||
// Created by gerp83 on 07/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckOpenApiValidationPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(CheckOpenApiValidationScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
23 changes: 23 additions & 0 deletions
23
Plugins/CheckUnacceptableLanguagePlugin/CheckUnacceptableLanguagePlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// CheckUnacceptableLanguagePlugin.swift | ||
// | ||
// Created by gerp83 on 06/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct CheckUnacceptableLanguagePlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
let _ = try context.createFile( | ||
fileName: "unacceptable-language.txt", | ||
fileContent: ScriptEnum.defaultUnaccepableLanguageValues.rawValue | ||
) | ||
try context.runScript(CheckUnaccepableLanguageScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/GenerateContributorsListPlugin/GenerateContributorsListPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// GenerateContributorsListPlugin.swift | ||
// | ||
// Created by gerp83 on 06/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct GenerateContributorsListPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(GenerateContributorsListScript()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
19 changes: 19 additions & 0 deletions
19
Plugins/InstallSwiftFormatPlugin/InstallSwiftFormatPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// InstallSwiftFormatPlugin.swift | ||
// | ||
// Created by gerp83 on 07/06/2024 | ||
// | ||
|
||
import PackagePlugin | ||
|
||
@main | ||
struct InstallSwiftFormatPlugin: CommandPlugin { | ||
|
||
func performCommand( | ||
context: PackagePlugin.PluginContext, | ||
arguments: [String] | ||
) async throws { | ||
try context.runScript(InstallSwiftFormatScript(), arguments) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Shared |
Oops, something went wrong.