Skip to content

Commit bc4876b

Browse files
committed
Moving comments because ruff is too stupid to cope with them
1 parent 0dca24a commit bc4876b

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

script_umdp3_checker/checker_dispatch_tables.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
Standalone version of the dispatch tables from UMDP3Job
99
Python translation of the original Perl module
1010
"""
11+
12+
from typing import Dict, Callable
13+
from umdp3_checker_rules import UMDP3Checker
14+
1115
"""
1216
ToDo : This list was checked to ensure it had something for each
1317
test in the original.
1418
"""
15-
from typing import Dict, Callable
16-
from umdp3_checker_rules import UMDP3Checker
1719

1820
# Declare version
1921
VERSION = "13.5.0"

script_umdp3_checker/tests/test_fortran_checks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
import sys
3-
import os
43
from pathlib import Path
54

65
# Add the current directory to Python path

script_umdp3_checker/tests/test_umdp3.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
from umdp3_checker_rules import UMDP3Checker, TestResult
2020
from checker_dispatch_tables import CheckerDispatchTables
21-
from typing import Callable, Iterable, List, Dict, Set
22-
from dataclasses import dataclass, field
2321

2422
# Prevent pytest from trying to collect TestResult as more tests:
2523
TestResult.__test__ = False
@@ -37,9 +35,6 @@ def test_basic_functionality():
3735
"This is a short line",
3836
"This is a very long line that exceeds eighty characters and should trigger a failure in the line length test",
3937
]
40-
expected = TestResult(
41-
checker_name="Line Length Check", failure_count=1, passed=False
42-
)
4338
result = umdp3_checker.line_over_80chars(test_lines)
4439
print(
4540
f"Line length test: {'PASS' if result.failure_count > 0 else 'FAIL'} (expected failure)"

script_umdp3_checker/umdp3_checker_rules.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
Package to contain functions which test for UMDP3 compliance.
99
Python translation of the original Perl UMDP3.pm module.
1010
"""
11-
"""
12-
ToDo : Several of the test functions are poor shadows of the original
13-
Perl versions. They would benefit from improving to catch more
14-
cases.
15-
Equally, there could probably be more consistancly in how things like comments are stripped from the ends of lines
16-
and/or full comment lines are skipped.
17-
"""
11+
1812
import re
1913
import threading
20-
from typing import List, Dict, Set
14+
from typing import List, Dict
2115
from fortran_keywords import fortran_keywords
2216
from search_lists import (
2317
obsolescent_intrinsics,
24-
openmp_keywords,
25-
fortran_types,
2618
unseparated_keywords_list,
2719
retired_ifdefs,
2820
deprecated_c_identifiers,
2921
)
3022
from dataclasses import dataclass, field
3123

24+
"""
25+
ToDo : Several of the test functions are poor shadows of the original
26+
Perl versions. They would benefit from improving to catch more
27+
cases.
28+
Equally, there could probably be more consistancly in how things like comments are stripped from the ends of lines
29+
and/or full comment lines are skipped.
30+
"""
31+
3232
# Declare version
3333
VERSION = "13.5.0"
3434

@@ -203,7 +203,7 @@ def openmp_sentinels_in_column_one(self, lines: List[str]) -> TestResult:
203203
self.add_extra_error("OpenMP sentinel not in column 1")
204204
failures += 1
205205
error_log = self.add_error_log(
206-
error_log, f"OpenMP sentinel not in column 1:", count + 1
206+
error_log, "OpenMP sentinel not in column 1:", count + 1
207207
)
208208
output = f"Checked {count+1} lines, found {failures} failures."
209209
return TestResult(

script_umdp3_checker/umdp3_conformance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import subprocess
22
from abc import ABC, abstractmethod
33
from pathlib import Path
4-
from typing import Callable, Iterable, List, Dict, Set
4+
from typing import Callable, List, Dict, Set
55
from dataclasses import dataclass, field
66
import argparse
77

@@ -353,7 +353,7 @@ def print_results(self, print_volume: int = 3) -> bool:
353353
)
354354
if test_result.errors:
355355
print(" " * 5 + "-=-" * 30)
356-
print(" " * 5 + f" Std Error :")
356+
print(" " * 5 + " Std Error :")
357357
for count, (title, info) in enumerate(
358358
test_result.errors.items()
359359
):

0 commit comments

Comments
 (0)