Skip to content

Commit

Permalink
Remove BEFORE-RELEASE comments (#434)
Browse files Browse the repository at this point in the history
As we have long released the aas-core-codegen in the wild, there is no
point of keeping a todo comments. At this point in time, we deprioritize
tests that we planned in the beginning.
  • Loading branch information
mristin authored Jan 19, 2024
1 parent 9142257 commit 973926a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion aas_core_codegen/csharp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def generate_type(
``our_type_prefix`` is appended to all our types, if specified.
"""
our_type_prefix = "" if our_type_qualifier is None else f"{our_type_qualifier}."
# BEFORE-RELEASE (mristin, 2021-12-13): test in isolation
if isinstance(type_annotation, intermediate.PrimitiveTypeAnnotation):
return PRIMITIVE_TYPE_MAP[type_annotation.a_type]

Expand Down
2 changes: 0 additions & 2 deletions aas_core_codegen/csharp/structure/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def _verify_intra_structure_collisions(
for prop in our_type.properties:
prop_name = csharp_naming.property_name(prop.name)
if prop_name in observed_member_names:
# BEFORE-RELEASE (mristin, 2021-12-13): test
errors.append(
Error(
prop.parsed.node,
Expand All @@ -202,7 +201,6 @@ def _verify_intra_structure_collisions(
method_name = csharp_naming.method_name(method.name)

if method_name in observed_member_names:
# BEFORE-RELEASE (mristin, 2021-12-13): test
errors.append(
Error(
method.parsed.node,
Expand Down
6 changes: 0 additions & 6 deletions aas_core_codegen/intermediate/_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,6 @@ def _determine_constrained_primitives_by_name(

# region Check the inheritances of all the constrained primitive types

# BEFORE-RELEASE (mristin, 2021-12-23): test this
for identifier in extended_map.keys():
# We know for sure that the initial set is valid, so we can skip it in
# the check.
Expand Down Expand Up @@ -1387,7 +1386,6 @@ def _determine_constrained_primitives_by_name(

# region Check that primitive types do not have unexpected specification

# BEFORE-RELEASE (mristin, 2021-12-23): test this
for identifier in result:
parsed_cls = parsed_symbol_table.must_find_class(identifier)
if len(parsed_cls.methods) > 0 or len(parsed_cls.properties) > 0:
Expand Down Expand Up @@ -3563,8 +3561,6 @@ def _second_pass_to_resolve_references_to_attributes_in_the_descriptions_in_plac
for attr_ref_in_doc, description, our_type in _find_all_in_descriptions(
element_type=doc.ReferenceToAttribute, symbol_table=symbol_table
):
# BEFORE-RELEASE (mristin, 2021-12-13):
# test this, especially the failure cases
if isinstance(attr_ref_in_doc.reference, _PlaceholderReferenceToAttribute):
pth = attr_ref_in_doc.reference.path

Expand Down Expand Up @@ -3823,8 +3819,6 @@ def visit_function_call(self, node: parse_tree.FunctionCall) -> None:
)

if verification_function is not None:
# BEFORE-RELEASE (mristin, 2021-12-19):
# test failure case
expected_argument_count = len(verification_function.arguments)
elif node.name.identifier == "len":
expected_argument_count = 1
Expand Down
3 changes: 0 additions & 3 deletions aas_core_codegen/intermediate/pattern_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ def try_to_understand(
None,
)

# BEFORE-RELEASE (mristin, 2021-12-19): test this
if (
isinstance(return_node.value, parse_tree.FunctionCall)
and return_node.value.name.identifier == "match"
Expand Down Expand Up @@ -288,7 +287,6 @@ def try_to_understand(
assert isinstance(match_call, parse_tree.FunctionCall)
assert match_call.name.identifier == "match"

# BEFORE-RELEASE (mristin, 2021-12-19): test this
if len(match_call.args) < 2:
return (
None,
Expand All @@ -301,7 +299,6 @@ def try_to_understand(
),
)

# BEFORE-RELEASE (mristin, 2021-12-19): test this
if len(match_call.args) > 2:
return (
None,
Expand Down
6 changes: 0 additions & 6 deletions aas_core_codegen/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,30 @@ def __init__(
def execute(params: Parameters, stdout: TextIO, stderr: TextIO) -> int:
"""Run the program."""
# region Basic checks
# BEFORE-RELEASE (mristin, 2021-12-13): test this failure case
if not params.model_path.exists():
stderr.write(f"The --model_path does not exist: {params.model_path}\n")
return 1

# BEFORE-RELEASE (mristin, 2021-12-13): test this failure case
if not params.model_path.is_file():
stderr.write(
f"The --model_path does not point to a file: {params.model_path}\n"
)
return 1

# BEFORE-RELEASE (mristin, 2021-12-13): test this failure case
if not params.snippets_dir.exists():
stderr.write(f"The --snippets_dir does not exist: {params.snippets_dir}\n")
return 1

# BEFORE-RELEASE (mristin, 2021-12-13): test this failure case
if not params.snippets_dir.is_dir():
stderr.write(
f"The --snippets_dir does not point to a directory: "
f"{params.snippets_dir}\n"
)
return 1

# BEFORE-RELEASE (mristin, 2021-12-13): test the happy path
if not params.output_dir.exists():
params.output_dir.mkdir(parents=True, exist_ok=True)
else:
# BEFORE-RELEASE (mristin, 2021-12-13): test this failure case
if not params.output_dir.is_dir():
stderr.write(
f"The --output_dir does not point to a directory: "
Expand Down
19 changes: 0 additions & 19 deletions aas_core_codegen/parse/_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,6 @@ def _args_to_arguments(
# region Default
default = None # type: Optional[Default]

# BEFORE-RELEASE (mristin, 2021-12-16):
# test the defaults in verification function
#
# BEFORE-RELEASE (mristin, 2021-12-16):
# test the defaults in a class method

# NOTE (mristin, 2021-12-16):
# A simple hypothetical test calculation:
# 5 args
Expand Down Expand Up @@ -1138,13 +1132,6 @@ def _parse_snapshot(
)


# BEFORE-RELEASE (mristin, 2021-12-13):
# include severity levels for contracts in the metamodel and
# consider them in the imports

# BEFORE-RELEASE (mristin, 2021-12-13):
# test for unknown severity level

# fmt: off
# noinspection PyTypeChecker,PyUnresolvedReferences
@ensure(
Expand Down Expand Up @@ -3374,7 +3361,6 @@ def _verify_symbol_table(
if isinstance(method, UnderstoodMethod)
),
):
# BEFORE-RELEASE (mristin, 2021-12-19): test
for stmt in understood_method.body:
if (
isinstance(stmt, tree.Assignment)
Expand All @@ -3395,7 +3381,6 @@ def _verify_symbol_table(

# region Check that no class methods are used in verification

# BEFORE-RELEASE (mristin, 2021-12-16): test
for our_type in symbol_table.our_types:
if not isinstance(our_type, Class):
continue
Expand Down Expand Up @@ -3569,7 +3554,6 @@ def verify_no_dangling_references_in_type_annotation(
if error is not None:
errors.append(error)
else:
# BEFORE-RELEASE (mristin, 2021-12-13): test
if isinstance(prop.type_annotation, SubscriptedTypeAnnotation):
error = _verify_arity_of_type_annotation_subscript(
prop.type_annotation
Expand All @@ -3587,7 +3571,6 @@ def verify_no_dangling_references_in_type_annotation(
if error is not None:
errors.append(error)
else:
# BEFORE-RELEASE (mristin, 2021-12-13): test
if isinstance(arg.type_annotation, SubscriptedTypeAnnotation):
error = _verify_arity_of_type_annotation_subscript(
arg.type_annotation
Expand All @@ -3597,14 +3580,12 @@ def verify_no_dangling_references_in_type_annotation(
errors.append(error)

if method.returns is not None:
# BEFORE-RELEASE (mristin, 2021-12-13): test
error = verify_no_dangling_references_in_type_annotation(
type_annotation=method.returns
)
if error is not None:
errors.append(error)
else:
# BEFORE-RELEASE (mristin, 2021-12-13): test
if isinstance(method.returns, SubscriptedTypeAnnotation):
error = _verify_arity_of_type_annotation_subscript(
method.returns
Expand Down
2 changes: 0 additions & 2 deletions aas_core_codegen/smoke/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def execute(model_path: pathlib.Path, stderr: TextIO) -> int:
"""Run the smoke test."""
text = model_path.read_text(encoding="utf-8")

# BEFORE-RELEASE (mristin, 2021-12-13):
# test all the following individual failure cases
atok, parse_exception = parse.source_to_atok(source=text)
if parse_exception:
if isinstance(parse_exception, SyntaxError):
Expand Down

0 comments on commit 973926a

Please sign in to comment.