如何将SwiftLint添加到Swift Vapor项目

jqjz2hbq  于 2023-03-11  发布在  Swift
关注(0)|答案(1)|浏览(103)

我试图将SwiftLint添加到我的Swift Vapor项目中,但没有运气找出这些错误。

全套服务。swift代码:

import PackageDescription

let package = Package(
    name: "VaporApp",
    platforms: [
       .macOS(.v10_15)
    ],
    dependencies: [
        // 💧 A server-side Swift web framework.
        .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
        .package(url: "https://github.com/realm/SwiftLint.git", from: "0.50.3")
    ],
    targets: [
        .target(
            name: "App",
            dependencies: [
                .product(name: "Vapor", package: "vapor")
            ],
            swiftSettings: [
                .unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
            ],
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
        ),
        .target(name: "Run", dependencies: [.target(name: "App")]),
        .testTarget(name: "AppTests", dependencies: [
            .target(name: "App"),
            .product(name: "XCTVapor", package: "vapor"),
        ])
    ]
)
xxhby3vn

xxhby3vn1#

需要将Package.swift文件中的工具版本至少设置为5.6

相关问题