Add a tool for the Clang Static Analyzer.

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

Information

ReviewBot
master
eac4689...

Reviewers

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.

Description From Last Updated

'logging' imported but unused

reviewbotreviewbot

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

chipx86chipx86

These can be combined.

chipx86chipx86
reviewbot
  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)
     
     
    Show all issues
     'logging' imported but unused
    
  3. 
      
brennie
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. bot/reviewbot/tools/clang.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    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)
     
     
     
    Show all issues

    These can be combined.

  4. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (d2a1230)