Menu

Problem with running addon directly from cppcheck

Łukasz
2019-07-18
2019-07-18
  • Łukasz

    Łukasz - 2019-07-18

    Since version 1.88 there is a possibility to run addons directly from cppcheck by using --addon option. I tried today to use it with namingng.py addon, but when I typed following command:

    cppcheck --enable=style --std=c++03 --addon=namingng.py [path-to-file]
    

    I received error message:

    usage: namingng.py [-h] [--debugprint] [--configfile CONFIGFILE] [--verify]
                       dumpfiles [dumpfiles ...]
    namingng.py: error: unrecognized arguments: --cli
    

    It is seems to me that propably cppcheck doesn't attach path to generated .dump file. However if I understand cppcheck manual right, it should:

    9.1 Running Addons

    Addons are standalone scripts that are executed separately.
    To manually run an addon:
    cppcheck --dump somefile.c
    python misc.py somefile.c.dump
    To run the same addon through Cppcheck directly:
    cppcheck --addon=misc.py somefile.c

    Could you tell me, how to correctly run this addon?

     
  • Daniel Marjamäki

    oh.. this addon does not handle --cli. So it cannot be executed directly. :-( We need to fix that.

    That argument tells the addons to output the results in JSON format so Cppcheck can parse it easily.

     
  • Łukasz

    Łukasz - 2019-07-18

    ok, I have to deal with it manually then. Thanks.

     

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.