Lowercase and CamelCase checking of module imports in UMDP3 checker
@Pierre-siddall is already working on this.
Since Apr 28, 2026.
Assessment
This issue has not been assessed yet.
Description
During the runtime of umdp3_conformance.py it was noted that changing module imports to be uppercase did not result in a failure being registered in the output of the script as expected. umdp3_conformance.py calls the following code in umdp3_checker_rules.py
def lowercase_variable_names(self, lines: List[str]) -> TestResult:
"""Check for lowercase or CamelCase variable names only"""
"""
TODO: This is a very simplistic check and will not detect many
cases which break UMDP3. I suspect the Perl Predecessor concatenated
continuation lines prior to 'cleaning' and checking. Having identified
a declaration, it also then scanned the rest of the file for that
variable name in any case."""
failures = 0
error_log = {}
count = -1
for count, line in enumerate(lines):
clean_line = self.remove_quoted(line)
clean_line = re.sub(r"!.*$", "", clean_line)
# Simple check for UPPERCASE variable declarations
if re.search(
r"^\s*(INTEGER|REAL|LOGICAL|CHARACTER|TYPE)\s*.*::\s*[A-Z_]+",
clean_line,
re.IGNORECASE,
):
clean_line = re.sub(
r"^\s*(INTEGER|REAL|LOGICAL|CHARACTER|TYPE)\s*.*::\s*",
"",
clean_line,
)
if match := re.search(r"([A-Z]{2,})", clean_line):
self.add_extra_error(f"UPPERCASE variable name : {match[1]}")
failures += 1
error_log = self.add_error_log(
error_log, f"UPPERCASE variable name {match[1]}", count +1
)
output = f"Checked {count + 1} lines, found {failures} failures."
return TestResult(
checker_name="Lowercase or CamelCase variable names only",
failure_count=failures,
passed=(failures == 0),
output=output,
errors=error_log,
)
addressing this issue will involve a refactor of this function to ensure module level imports are checked.
- Dominant language
- Python
- Stars
- 9
- Forks
- 19
- Avg merge
- 5d 48m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetOffice/SimSys_Scripts
-
enhancement
MetOffice/SimSys_Scripts#240 · 1 comment · 1 assignee ·
-
MetOffice/SimSys_Scripts#235 · 9 comments · 1 assignee ·
-
MetOffice/SimSys_Scripts#221 · 1 assignee ·
-
enhancement
MetOffice/SimSys_Scripts#217 · 4 comments · 1 assignee ·
-
bug
MetOffice/SimSys_Scripts#208 · 1 comment · 1 assignee ·
All issues in MetOffice/SimSys_Scripts
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·