Facebook Infer 过滤第三方

关于Infer的说明,在此就不再赘述--> 点我查看

最近在review QA同学发来的静态扫描(使用的是FB的Infer) report的时候,发现结果里大部分都是一些第三方库(project)的issue,
为了便于RD check,决定摒弃对第三方的扫描,然而真正去修改infer配置的时候,发现相关资料很少,去官网页是查了好久才有所发现,在此记录希望可以帮到其他朋友:

感谢@akotulski详细说明

How to include project folders or exclude dependency folders during analysis of iOS project? I
Yes, there is a way to exclude certain directories. I'll illustrate it by example let me know if it works for you.
If your use case is different/more complex let me know as well.

Let's say I have a project with following directory structure.

<ROOT>
  - <Lib> // libraries that your project depends on.
    - <ExternalDeps> // you want to skip analyzing those
    - <InternalLibs> // you want to analyze those
  - <Src> // implementation of your project 
  - <Headers> // headers of your project
  - <Docs> // irrelevant
We have a way of providing extra information to guide the analyzer by .inferconfig file (it's in json format)

Step 1:
Create .inferconfig file (name is important) in <ROOT> directory

Step 2:
Add entry for skip-clang-analysis-in-path with list of all paths relative to <ROOT>.
.inferconfig file should look like this:

{
    "skip-clang-analysis-in-path": [
        "Lib/ExternalDeps"
    ]
}
Step 3:
Run infer from <ROOT> directory (it's important for infer to find .inferconfig file there). If you have to run infer from different directory, you have pass --project-root flag to your infer invocation. And that's all.
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 项目管理术语英汉对照表2018-7-20 A Abstract Resource 抽象资源 Abstraction...
    007明_阳阅读 11,592评论 0 51
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 176,067评论 25 709
  • 有些专业的设计大师,就善于运用软性材料的质感做作品,往往一件并不起眼的材料,经过设计大师在质感和柔和性上下功夫思考...
    UYL阅读 1,225评论 0 0
  • “李荣华,天气不错。出去把事儿办了吧?”魏敏扑闪扑闪着大眼睛,柔声说道。 “办什么?”李荣华头都没抬,应了一句,仍...
    韦示人阅读 1,387评论 0 0
  • 8月立秋以来,身体匮乏无力,肩颈僵硬,头胀脑痛,口腔溃疡蔓延,身体虚弱无力,能量低到极点;对镜一照,脸蛋像涂了...
    雅月儿阅读 3,369评论 4 2

友情链接更多精彩内容