Skip to content

Generate commit match body on demand

Warren Gifford requested to merge cc/remove-commit-match-body into main

Created by: camdencheek

Currently, we store the matched content and ranges for commit matches in two places: in Body, and in either MessagePreview or DiffPreview. This is problematic because any changes require keeping the two places in sync. Additionally, it makes it harder to split the CommitMatch type into the more appropriate CommitMessageMatch and CommitDiffMatch (or whatever we end up calling them).

This moves the construction of the markdown-formatted body into a method on the CommitMatch type rather than being pre-computed. This makes it more clear that it is not a source of truth, and it makes it easier to rip out for when I eventually get to updating the APIs to return more general information to the clients (as opposed to pre-formatted markdown strings).

Merge request reports

Loading