diff --git a/platformio/commands/check/command.py b/platformio/commands/check/command.py index 2542ce17..03e5a018 100644 --- a/platformio/commands/check/command.py +++ b/platformio/commands/check/command.py @@ -165,7 +165,7 @@ def results_to_json(raw): { "ignored": item.get("succeeded") is None, "succeeded": bool(item.get("succeeded")), - "defects": [d.to_json() for d in item.get("defects", [])] + "defects": [d.as_dict() for d in item.get("defects", [])] } ) results.append(item) diff --git a/platformio/commands/check/defect.py b/platformio/commands/check/defect.py index adef3666..c28e60c1 100644 --- a/platformio/commands/check/defect.py +++ b/platformio/commands/check/defect.py @@ -81,7 +81,7 @@ class DefectItem(object): return key raise Exception("Unknown severity label -> %s" % label) - def to_json(self): + def as_dict(self): return { "severity": self.SEVERITY_LABELS[self.severity], "category": self.category,