首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Xcode中显示SwiftLint分析结果

在Xcode中显示SwiftLint分析结果
EN

Stack Overflow用户
提问于 2021-06-17 14:29:44
回答 1查看 107关注 0票数 0

我正在测试SwiftLint的(实验性) analyze特性,并且能够生成报告。现在,我想让它们返回到Xcode中,并将它们显示为警告和错误。

使用xcode格式化程序/报告器创建了此结构的文件:

代码语言:javascript
复制
/absolute/path/to/source/Scenes/UpdateOS/UpdateOSViewModel.swift:10:6: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)
/absolute/path/to/source/Scenes/UpdateOS/UpdateOSViewModel.swift:11:6: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)
/absolute/path/to/source/Scenes/UpdateOS/UpdateOSViewController.swift:7:7: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)
/absolute/path/to/source/Scenes/Home/Cells/Statistics/HomeStatisticsCellModel.swift:5:1: warning: Unused Import Violation: All imported modules should be required to make the file compile. (unused_import)
/absolute/path/to/source/Scenes/Home/Cells/Statistics/HomeStatisticsCellModel.swift:6:1: warning: Unused Import Violation: All imported modules should be required to make the file compile. (unused_import)
/absolute/path/to/source/Scenes/Home/Cells/Statistics/HomeStatisticsCard.swift:5:1: warning: Unused Import Violation: All imported modules should be required to make the file compile. (unused_import)
/absolute/path/to/source/Scenes/Home/Cells/Statistics/Extensions/SAP_Internal_Stats_Statistics+SupportedIDs.swift:5:1: warning: Unused Import Violation: All imported modules should be required to make the file compile. (unused_import)
/absolute/path/to/source/Scenes/Home/Cells/TraceLocations/HomeTraceLocationsCellModel.swift:10:6: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)
/absolute/path/to/source/Scenes/Home/Cells/TraceLocations/HomeTraceLocationsCellModel.swift:11:6: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)
/absolute/path/to/source/Scenes/Home/Cells/TraceLocations/HomeTraceLocationsCellModel.swift:12:6: error: Unused Declaration Violation: Declarations should be referenced at least once within all files linted. (unused_declaration)

有没有一种通用的方法可以将警告/错误列表‘加载’到Xcode中?我的第一个方法是XcodeKit扩展,但我希望这个问题已经解决了。

EN

回答 1

Stack Overflow用户

发布于 2021-10-04 17:59:50

我猜您已经找到了答案,但以防您还没有找到答案:error:warning:是在Xcode中自动解析和处理的,所以只要在"Run Script“构建阶段添加该命令就足够了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68014062

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档