Skip to content

Commit

Permalink
GixyBear.py: Add GixyBear
Browse files Browse the repository at this point in the history
This commit adds GixyBear.

Closes #1724
  • Loading branch information
suggoitanoshi committed Nov 5, 2018
1 parent dc8c95c commit b7d7126
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bears/general/GixyBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from coalib.bearlib.abstractions.Linter import linter
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.Result import Result
import json


@linter(executable='gixy')
class GixyBear:
severity_map = {"HIGH": RESULT_SEVERITY.MAJOR,
"MEDIUM": RESULT_SEVERITY.NORMAL,
"LOW": RESULT_SEVERITY.INFO}

@staticmethod
def create_arguments(filename, file, config_file):
return ("--format=json", filename)
def process_output(self, output, filename, file):
output = json.loads(output) if output else []
for issue in output:
yield Result.from_values(origin=issue["plugin"],
message=issue['description'],
additional_info=issue['reference'],
severity=self.severity_map[issue["severity"]],
file=filename)

0 comments on commit b7d7126

Please sign in to comment.