有什么方法可以让 xcode 中的静态分析器忽略整个目录吗?
我有一个项目依赖于一些外部资源,我不想更改它们。问题是,这些来源会生成大量警告,并且还会减慢在代码上运行分析器的整个过程。
所有这些要忽略的源文件都位于同一目录中,因此能够方便地将目录标记为分析器的禁止位置。
确实方便,但是可能吗?
I have a project that relies on the some external sources and I would prefer not to change them. The problem is that a lot of warnings are generated from these sources and it also slows down the whole process of running the analyzer on the code.
All these source files to be ignored are in the same directory so it would be convenient to able to flag the directory as a no go place for the analyzer.
Convenient yes, but possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看我的答案 这里。您可以向文件添加编译标志,静态分析器将忽略它们。
您可以通过多选文件、按 Enter 键、输入标志并再次按 Enter 键来批量添加标志。如果第三方代码已使用正确的名称间距编写,您应该能够使用过滤器仅显示这些目录中的文件。
See my answer here. You can add a compile flag to the files and static analyzer will ignore them.
You can mass add flags by multi-selecting files, pressing enter, entering the flags, and pressing enter again. If the third party code has been written with the proper name spacing, you should be able to use the filter to only show the files in those directories.
不知道如何才能像你提到的那样实现。但是,我会从这些文件(在该特定目录内)创建一个静态库,这将解决您的问题。
静态分析器不会进入静态库(.a 文件)并生成警告,因此您可以安全地运行它。
Dont know how it can be achieved like you mentioned. However, I would create a static library out of those files (inside that particular directory) and that will solve your problem.
Static analyzer does not go into static libraries (.a files) and generate warnings, so you are safe to run it.