Add JSHint tool plugin.

Review Request #6234 — Created Aug. 16, 2014 and submitted

anselina
ReviewBot
release-0.2.x
a64bfa3...
reviewbot

This adds support for running JSHint on JavaScript code. There are 3 options
that allow an admin to specify whether message codes should be included, which
file extensions JSHint should run on (besides .js), and whether JSHint should
extract JavaScript from HTML files.

Saw the JSHint tool show up in the "Installed Tools" list after refreshing it.

Created, modified, and deleted the tool.

Published review requests with .js and .html files, using various combinations
of options for the tool:
- default options (verbose=False, extra_ext_checks='',
extract_js_from_html='never')
- verbose=True, extra_ext_checks='', extract_js_from_html='never'
- verbose=True, extra_ext_checks='.html,.json', extract_js_from_html='auto'
- verbose=True, extra_ext_checks='.html', extract_js_from_html='always'
- verbose=True, extra_ext_checks='.html,.json', extract_js_from_html='never'

In all cases, I saw the expected results.


Description From Last Updated

We should do this once when the Tool executes, instead of for every file. Maybe something like: def execute(self, *args, ...

SM smacleod
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        bot/reviewbot/tools/jshint.py
        bot/setup.py
    
    Ignored Files:
        README.md
    
    
    
    Tool: Pyflakes
    Processed Files:
        bot/reviewbot/tools/jshint.py
        bot/setup.py
    
    Ignored Files:
        README.md
    
    
  2. 
      
david
  1. Looks pretty great!

  2. 
      
SM
  1. Looks great! Just the one issue to fix before landing :D

  2. bot/reviewbot/tools/jshint.py (Diff revision 1)
     
     
     

    We should do this once when the Tool executes, instead of for every file. Maybe something like:

    def execute(self, *args, **kwargs):
        super(JSHintTool, self).execute(*args, **kwargs)
    
        # Do the stuff here.
    
    1. I'm silly, that won't work, something like this:

      def handle_files(self, *args, **kwargs):
          # Do the stuff here.
      
          super(JSHintTool, self).handle_files(*args, **kwargs)
      
  3. 
      
anselina
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.2.x (1771c1f)
Loading...