Skip to content

Commit

Permalink
Удалять комментарии
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Jun 12, 2024
1 parent be207c1 commit e5ea5d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tools/automatic_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
MAX_ENTRIES = 500
HEADER_RE = r"(?::cl:|🆑)\s*(\w+)"
ENTRY_RE = r"^ *[*-] *(add|remove|tweak|fix): *(.*)"
COMMENT_RE = r"<!--.*?-->|<!--[\s\S]*?-->"

class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
Expand All @@ -24,6 +25,7 @@ def remove_implicit_resolver(cls, tag_to_remove):
NoDatesSafeLoader.remove_implicit_resolver('tag:yaml.org,2002:timestamp')

def parse_changelog(pr_body: str) -> List[dict]:
pr_body = re.sub(COMMENT_RE, '', pr_body, flags=re.MULTILINE)
header_match = re.search(HEADER_RE, pr_body, re.MULTILINE)
if not header_match:
return []
Expand Down

0 comments on commit e5ea5d0

Please sign in to comment.