Skip to content

Commit

Permalink
Merge branch 'main' into protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
g1zzm0 authored Apr 23, 2024
2 parents 81fb62e + 464be4a commit 4fcd0a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ dmypy.json
.idea/

# generated output
out/*
out/
# namespace configuration for output
snippets/namespace.txt
2 changes: 1 addition & 1 deletion aas_core_codegen/java/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def enum_literal_name(identifier: Identifier) -> Identifier:
>>> enum_literal_name(Identifier("URL_to_something"))
'URL_TO_SOMETHING'
"""
return aas_core_codegen.naming.upper_pascal_case(identifier)
return aas_core_codegen.naming.upper_snake_case(identifier)


def class_name(identifier: Identifier) -> Identifier:
Expand Down
7 changes: 4 additions & 3 deletions aas_core_codegen/naming.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate names from our ``Pascal_case`` for the respective targets."""
"""Generate names from ``Our_identifier_snake_case`` to other cases."""

from typing import List

from icontract import ensure, require
Expand All @@ -7,7 +8,7 @@


def lower_snake_case(identifier: Identifier) -> Identifier:
"""Convert the identifier to a ``pascal_case``."""
"""Convert the identifier to a ``lower_snake_case``."""
parts = identifier.split("_")

assert len(parts) > 0, "Expected at least one part in the identifier"
Expand All @@ -16,7 +17,7 @@ def lower_snake_case(identifier: Identifier) -> Identifier:


def upper_snake_case(identifier: Identifier) -> Identifier:
"""Convert the identifier to a ``PASCAL_CASE``."""
"""Convert the identifier to a ``UPPER_SNAKE_CASE``."""
parts = identifier.split("_")

assert len(parts) > 0, "Expected at least one part in the identifier"
Expand Down

0 comments on commit 4fcd0a2

Please sign in to comment.