Menu

Can we add an option to assign config path?

Wu Zhenyu
2023-10-02
2023-10-08
  • Wu Zhenyu

    Wu Zhenyu - 2023-10-02

    In order to use cppcheck with pre-commit, I try to package cppcheck as a python wheel. Attachment is code. However:

     ptpython
    In [1]: from cppcheck import cppcheck
    In [2]: cppcheck("--enable=all", "--error-exitcode=1", "/home/wzy/Desktop/cppcheck-wheel/tests/input.c")
    cppcheck: Failed to load library configuration file 'std.cfg'. File not found
    Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with FILESDIR set to "/tmp/tmp4jbtnk_g/wheel/platlib/cppcheck/data/share/Cppcheck" and will therefore search for std.cfg in /tmp/tmp4jbtnk_g/wheel/platlib/cppcheck/data/share/Cppcheck/cfg.
    

    Can we cppcheck --cfg=XXXX to change search path?

     
  • Daniel Marjamäki

    setting /tmp/tmp4jbtnk_g/wheel/platlib/cppcheck/data/share/Cppcheck as FILESDIR seems unfortunate. Can't you skip the FILESDIR and put the cppcheck binary and configuration files together?

     
  • Wu Zhenyu

    Wu Zhenyu - 2023-10-07

    How to skip the FILESDIR?

     
  • Daniel Marjamäki

    Do not use -DFILESDIR when you compile cppcheck

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.