# Path: checkmate/contrib/plugins/javascript/jshint/analyzer.py
# class JSHintAnalyzer(BaseAnalyzer):
# 
#     def __init__(self, *args, **kwargs):
#         super(JSHintAnalyzer, self).__init__(*args, **kwargs)
#         try:
#             result = subprocess.check_output(["jshint","--version"])
#         except subprocess.CalledProcessError:
#             logger.error("Cannot initialize JSHint analyzer: Executable is missing, please install it.")
#             raise
# 
#     def summarize(self,items):
#         pass
# 
#     def analyze(self,file_revision):
#         issues = []
#         f = tempfile.NamedTemporaryFile(delete = False)
#         try:
#             with f:
#                 f.write(file_revision.get_file_content())
#             try:
#                 result = subprocess.check_output(["jshint",
#                                                   "--filename",
#                                                   file_revision.path,
#                                                   "--reporter",
#                                                   os.path.join(os.path.abspath(__file__+"/.."),
#                                                                'js/json_reporter'),
#                                                   f.name])
#             except subprocess.CalledProcessError as e:
#                 if e.returncode == 2:
#                     result = e.output
#                 else:
#                     raise
#             json_result = json.loads(result)
#             for issue in json_result:
#                 location = (((issue['error']['line'],issue['error']['character']),
#                               (issue['error']['line'],None)),)
#                 issues.append({
#                     'code' : issue['error']['code'],
#                     'location' : location,
#                     'data' : issue['error'],
#                     'fingerprint' : self.get_fingerprint_from_code(file_revision,location, extra_data=issue['error'])
#                     })
# 
#         finally:
#             os.unlink(f.name)
#         return {'issues' : issues}
# 
# Path: checkmate/contrib/plugins/javascript/jshint/issues_data.py



from .analyzer import JSHintAnalyzer
from .issues_data import issues_data

analyzers = {
    'jshint' :
        {
            'title' : 'JSHint',
            'class' : JSHintAnalyzer,
            'language' : 'javascript',

# Path: checkmate/contrib/plugins/javascript/jshint/analyzer.py
# class JSHintAnalyzer(BaseAnalyzer):
# 
#     def __init__(self, *args, **kwargs):
#         super(JSHintAnalyzer, self).__init__(*args, **kwargs)
#         try:
#             result = subprocess.check_output(["jshint","--version"])
#         except subprocess.CalledProcessError:
#             logger.error("Cannot initialize JSHint analyzer: Executable is missing, please install it.")
#             raise
# 
#     def summarize(self,items):
#         pass
# 
#     def analyze(self,file_revision):
#         issues = []
#         f = tempfile.NamedTemporaryFile(delete = False)
#         try:
#             with f:
#                 f.write(file_revision.get_file_content())
#             try:
#                 result = subprocess.check_output(["jshint",
#                                                   "--filename",
#                                                   file_revision.path,
#                                                   "--reporter",
#                                                   os.path.join(os.path.abspath(__file__+"/.."),
#                                                                'js/json_reporter'),
#                                                   f.name])
#             except subprocess.CalledProcessError as e:
#                 if e.returncode == 2:
#                     result = e.output
#                 else:
#                     raise
#             json_result = json.loads(result)
#             for issue in json_result:
#                 location = (((issue['error']['line'],issue['error']['character']),
#                               (issue['error']['line'],None)),)
#                 issues.append({
#                     'code' : issue['error']['code'],
#                     'location' : location,
#                     'data' : issue['error'],
#                     'fingerprint' : self.get_fingerprint_from_code(file_revision,location, extra_data=issue['error'])
#                     })
# 
#         finally:
#             os.unlink(f.name)
#         return {'issues' : issues}
# 
# Path: checkmate/contrib/plugins/javascript/jshint/issues_data.py



# Path: checkmate/contrib/plugins/javascript/jshint/setup.py
from .analyzer import JSHintAnalyzer
from .issues_data import issues_data


analyzers = {
    'jshint' :
        {
            'title' : 'JSHint',
            'class' : JSHintAnalyzer,
            'language' : 'javascript',

            'issues_data' : issues_data,