Menu

Checking individual files, based on project settings

Yair Lenga
2025-08-29
2025-09-01
  • Yair Lenga

    Yair Lenga - 2025-08-29

    Hi,

    I'm working on integration of cpp-check into CI pipeline. I have a large
    project, with automatically generated compile_commands.json. For my use
    case I need to check small number of files.

    I can use the "--project" to get the correct build flag for each file, but
    that will trigger check on all files. I can use the list of named files -
    but that forces passing the required-I/-D for each file. Is there a way to
    achieve both:
    * Run cppcheck on list of files.
    * Retrieve the -D/-I/etc from the compile_commands.json

    This can be implemented using wrapper scripts (python, jq, ...) - but it
    feels that it should be better for cppcheck to support this combination of
    build. It will also make integration with with other tools
    (vim/emacs/vscode/...) easier.

    Looking for feedback.

    Yair

     
  • Oliver Stöneberg

    There's a WIP PR but I keep getting side tracked by more pressing stuff. See https://github.com/danmar/cppcheck/pull/6754

     

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.