Add a tool for the Clang Static Analyzer.

Review Request #8819 - Created March 16, 2017 and submitted

David Trowbridge
ReviewBot
master
eac4689...
reviewbot

This change adds a new Review Bot tool to run clang --analyze.

Setting up clang properly requires some configuration. In particular, the
static analyzer needs the compiler to be able to run successfully (though not
the linker), so the user may need to add a bunch of import paths or other
configuration to the command line. I've facilitated this by including a setting
for additional command-line arguments, which is split with shlex and then
appended to the clang command line.

Clang is the first tool that can actually report multiple lines per comment.
I've fixed up the review functionality to properly translate the line numbers
for this.

Connected the git repository to my local Review Board, configured it in the
Review Bot worker, and then used the post-commit UI to create review requests
for a bunch of different commits. Most of them are pretty clean, but saw that
in a few cases, the clang static analyzer ran successfully and reported the
bugs.

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        bot/setup.py
        bot/reviewbot/processing/review.py
        bot/reviewbot/tools/clang.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        bot/setup.py
        bot/reviewbot/processing/review.py
        bot/reviewbot/tools/clang.py
    
    
  2. bot/reviewbot/tools/clang.py (Diff revision 1)
     
     
     'logging' imported but unused
    
  3. 
      
Barret Rennie
  1. Ship It!
  2. 
      
Christian Hammond
  1. 
      
  2. bot/reviewbot/tools/clang.py (Diff revision 1)
     
     
     
     
     
     

    endswith can take a tuple of things to check, instead of having to make repeated calls.

  3. bot/reviewbot/tools/clang.py (Diff revision 1)
     
     
     

    These can be combined.

  4. 
      
David Trowbridge
Christian Hammond
  1. Ship It!
  2. 
      
David Trowbridge
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (d2a1230)
Loading...