Skip to content

Commit

Permalink
Fix codeclimate description output (#2149)
Browse files Browse the repository at this point in the history
Codeclimate description output was previously not useful for complex
rules like yaml and schemas, as it lacked proper check_name and the
description was too verbose and generic.

Fixes: #2106
  • Loading branch information
ssbarnea authored May 17, 2022
1 parent 0b4f56e commit 7225a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ansiblelint/formatters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ def format_result(self, matches: List["MatchError"]) -> str:
for match in matches:
issue: Dict[str, Any] = {}
issue["type"] = "issue"
issue["check_name"] = f"[{match.rule.id}] {match.message}"
issue["check_name"] = match.tag or match.rule.id # rule-id[subrule-id]
issue["categories"] = match.rule.tags
issue["severity"] = self._severity_to_level(match.rule.severity)
issue["description"] = self.escape(str(match.rule.description))
issue["description"] = self.escape(str(match.message))
issue["fingerprint"] = hashlib.sha256(
repr(match).encode("utf-8")
).hexdigest()
Expand Down

0 comments on commit 7225a51

Please sign in to comment.