Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/in_container/verify_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ def is_camel_case_with_acronyms(s: str):
:param s: string to check
:return: true if the name looks cool as Class name.
"""
if s and s[0] == "_": # Leading underscores are fine.
s = s[1:]
if not s:
return True
return s != s.lower() and s != s.upper() and "_" not in s and s[0].upper() == s[0]


Expand All @@ -567,7 +571,8 @@ def check_if_classes_are_properly_named(
if not is_camel_case_with_acronyms(class_name):
console.print(
f"[red]The class {class_full_name} is wrongly named. The "
f"class name should be CamelCaseWithACRONYMS ![/]"
f"class name should be CamelCaseWithACRONYMS optionally "
f"with a single leading underscore[/]"
)
error_encountered = True
if not class_name.endswith(class_suffix):
Expand Down