【问题标题】:How to ignore generated cpp files (from swig/python) in Coverity Scan?如何在 Coverity Scan 中忽略生成的 cpp 文件(来自 swig/python)?
【发布时间】:2018-01-27 07:10:57
【问题描述】:

我有一个 C++ 项目,其中包含 SWIG 生成的 Python 绑定。我从 SWIG 获得了一个生成的文件 python/libproj_wrap.cpp。此文件在.gitignore 中列出。

我正在通过 Travis 运行 Coverity Scan。 Coverity Scan 似乎试图对此运行 git blame,但失败了:

fatal: no such path 'python/libproj_wrap.cpp' in HEAD
[WARNING] An error occurred while executing command at '/home/travis/build/unhammer/proj/python':
COMMAND: '/usr/bin/git blame -p proj_wrap.cpp' failed. Error code 128. Proceeding...

我没有得到任何扫描结果。有没有办法告诉 Coverity Scan 忽略 .gitignore'd 的东西,或者我应该只在没有 SWIG 绑定的构建上运行扫描?

【问题讨论】:

    标签: python c++ git swig coverity


    【解决方案1】:

    如果python/libproj_wrap.cpp 在被添加到.gitignore 之前 被跟踪,就会发生这种情况。

    为了确定,请尝试取消跟踪它:

    git rm --cached python/libproj_wrap.cpp
    git commit -m "untrack python/libproj_wrap.cpp"
    git push
    

    并查看 Travis 是否仍在尝试在该文件上使用 git blame

    【讨论】:

    猜你喜欢
    • 2018-02-23
    • 2017-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多