Lowercase and CamelCase checking of module imports in UMDP3 checker
@Pierre-siddall đang làm issue này rồi.
Từ ngày 28/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 9
- Fork
- 19
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MetOffice/SimSys_Scripts
-
Identification of CPP directives in UMDP3_checkerCó thể làm lại được @r-sharp đã nhận 67 ngày trước và không có pull request nào đang mở. Đang mởenhancement
MetOffice/SimSys_Scripts#240 · 1 bình luận · 1 người được giao ·
-
UMDP3 checker incorrectly identifies .....Có thể làm lại được @r-sharp đã nhận 67 ngày trước và không có pull request nào đang mở. Đang mở
MetOffice/SimSys_Scripts#235 · 9 bình luận · 1 người được giao ·
-
UMDP3 checker can't be passed a single file to checkCó thể làm lại được @r-sharp đã nhận 67 ngày trước và không có pull request nào đang mở. Đang mở
MetOffice/SimSys_Scripts#221 · 1 người được giao ·
-
Encapsulate git functions into a Fab-compatible classCó thể làm lại được @hiker đã nhận 196 ngày trước và không có pull request nào đang mở. Đang mởenhancement
MetOffice/SimSys_Scripts#217 · 4 bình luận · 1 người được giao ·
-
Update diff commands in UMDP3 fixerCó thể làm lại được @Pierre-siddall đã nhận 201 ngày trước và không có pull request nào đang mở. Đang mởbug
MetOffice/SimSys_Scripts#208 · 1 bình luận · 1 người được giao ·
Tất cả issue của MetOffice/SimSys_Scripts
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
data-umbrella/du-event-board#225 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100