当我在项目中的Kingfisher库上运行swiftlint时,我得到了以下错误。我运行的是Swift 5.1.2 XCode 11.2.1
Testing failed:
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, SessionDelegate.SessionChallengeFunc) -> Void)?' (aka 'Optional<(_, (URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, Optional<URLCredential>) -> ())) -> ()>')
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, SessionDelegate.SessionTaskChallengeFunc) -> Void)?' (aka 'Optional<(_, (URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, Optional<URLCredential>) -> ())) -> ()>')
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, Int) -> Bool)?'
Cannot convert value of type '() -> ()' to expected argument type '((_, (URL, Result<URLResponse, KingfisherError>)) -> Void)?'
Use of unresolved identifier 'task'
Use of unresolved identifier 'task'
Unable to infer complex closure return type; add explicit type to disambiguate
Cannot convert value of type '() -> ()' to expected argument type '((_, (Result<(Data, URLResponse?), KingfisherError>, [SessionDataTask.TaskCallback])) -> Void)?'
Expected ',' separator
Consecutive statements on a line must be separated by ';'
Consecutive statements on a line must be separated by ';'
Expected expression
Cannot convert value of type '() -> ()' to expected argument type '((_, (SessionDataTask.CancelToken, SessionDataTask.TaskCallback)) -> Void)?' (aka 'Optional<(_, (Int, SessionDataTask.TaskCallback)) -> ()>')
Command MergeSwiftModule failed with a nonzero exit code
Insufficient indentation of next 2 lines in multi-line string literal
Command CompileSwift failed with a nonzero exit code
Testing cancelled because the build failed.我试过下面的方法: swift run swiftformat。swiftlint自动更正
但是没有骰子,我已经把它装成了一个cocoapod。在我打开翠鸟项目本身的问题之前,我在这里问。
发布于 2020-03-09 23:19:05
当swiftFormat的脚本自动更正翠鸟pod时,我遇到了一个非常类似的问题。您需要手动(或通过pod deintegrate)删除pod,重新安装它(以逆转更改),然后,如果您像我一样,在构建阶段将swiftlint作为脚本调用,请将其更改为
"${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat" . --exclude Pods,Generatedhttps://stackoverflow.com/questions/59439911
复制相似问题