[PATCH] D9600: Add scan-build python implementation

Kim Gräsman via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 13 00:06:28 PST 2015


kimgr added a subscriber: kimgr.
kimgr added a comment.

> ================

>  Comment at: tools/scan-build-py/bin/analyze-cc:14

>  @@ +13,2 @@

>  +from libscanbuild.analyze import wrapper

>  +sys.exit(wrapper(False))

> 

>  ----------------

> 

> It is hard to figure out/search which functions actually get called from the top level tools. Could you rename all of the public functions so that they

>  have unique names? For example, "wrapper" -> "scan_build_wrapper". This would greatly improve searchability!


A nice pattern in Python is to avoid importing individual
functions/classes, and instead use the module name as a namespace,
e.g.

  from libscanbuild import analyze
  sys.exit(analyze.wrapper(False))

I don't know if that addresses your concern? I haven't looked at the
code in more detail.

- Kim


http://reviews.llvm.org/D9600





More information about the cfe-commits mailing list