我试图将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"),
])
]
)
1条答案
按热度按时间xxhby3vn1#
需要将Package.swift文件中的工具版本至少设置为5.6