Coverage for /home/delusionalinsanity/bbrepos/matyan/src/matyan/renderers/markdown.py: 96%

# Coverage for /home/delusionalinsanity/bbrepos/matyan/src/matyan/renderers/markdown.py : 96%

## 27 statements 26 run 1 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | from typing import Dict from ..labels import BRANCH_TYPES, BRANCH_TYPE_OTHER from .base import BaseRenderer __author__ = 'Artur Barseghyan' __copyright__ = '2019 Artur Barseghyan' __license__ = 'GPL-2.0-only OR LGPL-2.0-or-later' __all__ = ( 'MarkdownRenderer', 'HistoricalMarkdownRenderer', ) class MarkdownRenderer(BaseRenderer): uid: str = 'markdown' def append_release(self, release_label: str): self.changelog.append("\n### {}".format(release_label)) def append_feature_type(self, branch_type: str): self.changelog.append( "\n#### {}{}".format( BRANCH_TYPES.get(branch_type), '\n' if branch_type == BRANCH_TYPE_OTHER else '' ) ) def append_ticket_title(self, ticket_number: str, ticket_title: str): self.changelog.append( "\n##### {} {}".format( ticket_number, ticket_title ) ) def append_ticket_description(self, ticket_description: str): self.changelog.append( "\n```\n{}\n```".format( ticket_description.strip() ) ) def append_commit_message(self, commit_data: Dict[str, str], branch_type: str, counter: int = 0): self.changelog.append( "{}- {} [{}]".format( ( '\n' if counter == 0 and branch_type != BRANCH_TYPE_OTHER else '' ), commit_data['title'], commit_data['author'] ) ) class HistoricalMarkdownRenderer(MarkdownRenderer): uid: str = 'historical-markdown' def append_release(self, release_label: str): self.changelog.append("\n### {}".format(release_label)) def append_feature_type(self, branch_type: str): self.changelog.append( "\n**{}**{}".format( BRANCH_TYPES.get(branch_type), '\n' if branch_type == BRANCH_TYPE_OTHER else '' ) ) def append_ticket_title(self, ticket_number: str, ticket_title: str): self.changelog.append( "\n*{} {}*".format( ticket_number, ticket_title ) )