Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __parse_returns_tag(self, name, desc):
desc, annotations = self.__extract_annotations(desc)
annotations = {annotation.name: annotation for annotation in
annotations}
return Tag(name, desc, annotations=annotations)
def __parse_since_tag(self, name, desc):
return Tag(name, desc, value=desc)
def __parse_stability_tag(self, name, desc):
value = desc.strip().lower()
if value not in ('private', 'stable', 'unstable'):
# FIXME warn
return None
return Tag(name, desc, value=value)
def __parse_topic_tag(self, name, desc):
return Tag(name, None, value=desc)
def __add_default_tags(self, _, comment):
for validator in list(self.tag_validators.values()):
if validator.default and validator.name not in comment.tags:
comment.tags[validator.name] = \
Tag(name=validator.name,
description=validator.default)