Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
version 0.0.1 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
GErP83 authored Jun 18, 2024
1 parent 65137fb commit 1c4b4fb
Show file tree
Hide file tree
Showing 43 changed files with 1,192 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .gitignore
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
43 changes: 43 additions & 0 deletions Makefile
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

146 changes: 146 additions & 0 deletions Package.swift
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 Plugins/CheckApiBreakagePlugin/CheckApiBreakagePlugin.swift
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckApiBreakagePlugin/Shared
19 changes: 19 additions & 0 deletions Plugins/CheckBrokenSymlinksPlugin/CheckBrokenSymlinksPlugin.swift
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckBrokenSymlinksPlugin/Shared
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckLocalSwiftDependenciesPlugin/Shared
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckOpenApiSecurityPlugin/Shared
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckOpenApiValidationPlugin/Shared
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())
}

}
1 change: 1 addition & 0 deletions Plugins/CheckUnacceptableLanguagePlugin/Shared
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())
}

}
1 change: 1 addition & 0 deletions Plugins/GenerateContributorsListPlugin/Shared
19 changes: 19 additions & 0 deletions Plugins/InstallSwiftFormatPlugin/InstallSwiftFormatPlugin.swift
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)
}

}
1 change: 1 addition & 0 deletions Plugins/InstallSwiftFormatPlugin/Shared
Loading

0 comments on commit 1c4b4fb

Please sign in to comment.