Skip to content

Commit 8d8229a

Browse files
james-bruten-mor-sharp
authored andcommitted
try removing fix_ (MetOffice#194)
* try removing fix_ * fix ruff lint issues * update umdp3_fixer * rerun format * output-format
1 parent 510e0a7 commit 8d8229a

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

script_umdp3_checker/umdp3_checker_rules.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ def unseparated_keywords(self, lines: List[str]) -> TestResult:
252252
if line.lstrip(" ").startswith("!"):
253253
continue
254254
clean_line = self.remove_quoted(line)
255-
for pattern in [f"\\b{kw}\\b" for kw in
256-
unseparated_keywords_list]:
255+
for pattern in [f"\\b{kw}\\b" for kw in unseparated_keywords_list]:
257256
if re.search(pattern, clean_line, re.IGNORECASE):
258257
self.add_extra_error(f"unseparated keyword in line: {line.strip()}")
259258
failures += 1

script_umdp3_checker/umdp3_conformance.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ def check_files(self) -> None:
338338
self.results = results
339339
return
340340

341-
def print_results(self, print_volume: int = 3,
342-
quiet_pass: bool = True) -> bool:
341+
def print_results(self, print_volume: int = 3, quiet_pass: bool = True) -> bool:
343342
"""Print results and return True if all checks passed.
344343
========================================================"""
345344
"""
@@ -373,8 +372,7 @@ def print_results(self, print_volume: int = 3,
373372
for count, (title, info) in enumerate(
374373
test_result.errors.items()
375374
):
376-
print(" " * 8 +
377-
f"{count + 1:2} : {title} : {info}")
375+
print(" " * 8 + f"{count + 1:2} : {title} : {info}")
378376
print(" " * 8 + line_2(82))
379377
elif print_volume >= 3:
380378
print(f" {test_result.checker_name:60s} : ✓ PASS")
@@ -407,8 +405,7 @@ def process_arguments():
407405
"-p", "--path", type=str, default="./", help="path to repository"
408406
)
409407
parser.add_argument(
410-
"--max-workers", type=int, default=8,
411-
help="Maximum number of parallel workers"
408+
"--max-workers", type=int, default=8, help="Maximum number of parallel workers"
412409
)
413410
parser.add_argument(
414411
"--fullcheck",
@@ -424,12 +421,10 @@ def process_arguments():
424421
)
425422
group = parser.add_mutually_exclusive_group()
426423
group.add_argument(
427-
"-v", "--verbose", action="count", default=0,
428-
help="Increase output verbosity"
424+
"-v", "--verbose", action="count", default=0, help="Increase output verbosity"
429425
)
430426
group.add_argument(
431-
"-q", "--quiet", action="count", default=0,
432-
help="Decrease output verbosity"
427+
"-q", "--quiet", action="count", default=0, help="Decrease output verbosity"
433428
)
434429
# The following are not yet implemented, but may become useful
435430
# branch and base branch could be used to configure the CMS diff
@@ -507,15 +502,13 @@ def which_cms_is_it(path: str, print_volume: int = 3) -> CMSSystem:
507502

508503

509504
def create_style_checkers(
510-
file_types: List[str], changed_files: List[Path],
511-
print_volume: int = 3
505+
file_types: List[str], changed_files: List[Path], print_volume: int = 3
512506
) -> List[StyleChecker]:
513507
"""Create style checkers based on requested file types."""
514508
dispatch_tables = CheckerDispatchTables()
515509
checkers = []
516510
if "Fortran" in file_types:
517-
file_extensions = {".f", ".for", ".f90", ".f95",
518-
".f03", ".f08", ".F90"}
511+
file_extensions = {".f", ".for", ".f90", ".f95", ".f03", ".f08", ".F90"}
519512
fortran_diff_table = dispatch_tables.get_diff_dispatch_table_fortran()
520513
fortran_file_table = dispatch_tables.get_file_dispatch_table_fortran()
521514
generic_file_table = dispatch_tables.get_file_dispatch_table_all()
@@ -643,8 +636,7 @@ def get_files_to_check(
643636
print(line_1(81) + "\n")
644637
else:
645638
print("Results :")
646-
all_passed = checker.print_results(print_volume=log_volume,
647-
quiet_pass=quiet_pass)
639+
all_passed = checker.print_results(print_volume=log_volume, quiet_pass=quiet_pass)
648640
if log_volume >= 4:
649641
print("\n" + line_1(81))
650642
print("## Summary :" + " " * 67 + "##")

0 commit comments

Comments
 (0)