Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
added _validate_annotation pattern to avoid duplicate generation of v…
Browse files Browse the repository at this point in the history
…alidate annotation method
  • Loading branch information
haeussma committed Apr 19, 2024
1 parent 76acc9d commit 9cff4b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ipython_config.py
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
5 changes: 4 additions & 1 deletion sdRDM/generator/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
FUNCTION_PATTERN = r"def ([a-zA-Z0-9_]+)\("
FUNCTION_NAME_PATTERN = r"def ([a-zA-Z0-9_]+)\("
XML_PARSER_PATTERN = r"_parse_raw_xml_data"
ANNOTATION_PATTERN = r"_validate_annotation"


class ModuleOrder(Enum):
Expand Down Expand Up @@ -72,9 +73,11 @@ def extract_custom_methods(rendered_class: str, path: str) -> List[str]:
if not re.findall(FUNCTION_PATTERN, line):
continue

# Ignore adder functions
# Ignore adder, annotation, and xml parser functions
if re.findall(ADDER_PATTERN, line):
continue
elif re.findall(ANNOTATION_PATTERN, line):
continue
elif re.findall(XML_PARSER_PATTERN, line):
continue

Expand Down

0 comments on commit 9cff4b2

Please sign in to comment.