Skip to content

Commit e9b5e1d

Browse files
r-sharpPierre-siddallericaneininger
committed
Tweaks to get VSCode's internal linters to quit whinging and make the… (MetOffice#173)
* Tweaks to get VSCode's internal linters to quit whinging and make the ToDo plugin work nicely. * Touch O Tidying and ToDo commenting. * reviewer request to Update script_umdp3_checker/umdp3_conformance.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Update script_umdp3_checker/umdp3_checker_rules.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Update script_umdp3_checker/umdp3_checker_rules.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Update script_umdp3_checker/umdp3_checker_rules.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Update script_umdp3_checker/umdp3_checker_rules.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Update script_umdp3_checker/umdp3_checker_rules.py Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com> * Rreviwer requested changes that I was unable to commit via GitHub's web interface --------- Co-authored-by: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com>
1 parent b4be82e commit e9b5e1d

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

script_umdp3_checker/umdp3_checker_rules.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
TODO : Several of the test functions are poor shadows of the original
2626
Perl versions. They would benefit from improving to catch more
2727
cases.
28+
<<<<<<< HEAD
2829
Equally, there could probably be more consistancly in how things
30+
=======
31+
Equally, there could probably be more consistency in how things
32+
>>>>>>> 674ed15 (Tweaks to get VSCode's internal linters to quit whinging and make the… (#173))
2933
like comments are stripped from the ends of lines
3034
and/or full comment lines are skipped.
3135
"""
@@ -100,7 +104,11 @@ def get_extra_error_information(self) -> Dict:
100104
def add_extra_error(self, key: str, value: str = ""):
101105
"""Add extra error information to the dictionary"""
102106
"""
107+
<<<<<<< HEAD
103108
TODO: The usefulness of the information added has not been assesed,
109+
=======
110+
TODO: The usefulness of the information added has not been assessed,
111+
>>>>>>> 674ed15 (Tweaks to get VSCode's internal linters to quit whinging and make the… (#173))
104112
nor does it appear to be reported as yet."""
105113
with self._lock:
106114
self._extra_error_info[key] = value
@@ -326,7 +334,11 @@ def lowercase_variable_names(self, lines: List[str]) -> TestResult:
326334
"""Check for lowercase or CamelCase variable names only"""
327335
"""
328336
TODO: This is a very simplistic check and will not detect many
337+
<<<<<<< HEAD
329338
cases which break UMDP3. I suspect the Perl Predeccessor concattenated
339+
=======
340+
cases which break UMDP3. I suspect the Perl Predecessor concatenated
341+
>>>>>>> 674ed15 (Tweaks to get VSCode's internal linters to quit whinging and make the… (#173))
330342
continuation lines prior to 'cleaning' and checking. Having identified
331343
a declaration, it also then scanned the rest of the file for that
332344
variable name in any case."""
@@ -343,16 +355,22 @@ def lowercase_variable_names(self, lines: List[str]) -> TestResult:
343355
clean_line,
344356
re.IGNORECASE,
345357
):
358+
<<<<<<< HEAD
346359
# print("Debug: Found variable declaration line: "
347360
# f"{clean_line}")
361+
=======
362+
>>>>>>> 674ed15 (Tweaks to get VSCode's internal linters to quit whinging and make the… (#173))
348363
clean_line = re.sub(
349364
r"^\s*(INTEGER|REAL|LOGICAL|CHARACTER|TYPE)\s*.*::\s*",
350365
"",
351366
clean_line,
352367
)
353368
if re.search(r"[A-Z]{2,}", clean_line):
369+
<<<<<<< HEAD
354370
# print(f"Debug: Found UPPERCASE variable name: "
355371
# f"{clean_line}")
372+
=======
373+
>>>>>>> 674ed15 (Tweaks to get VSCode's internal linters to quit whinging and make the… (#173))
356374
self.add_extra_error("UPPERCASE variable name")
357375
failures += 1
358376
error_log = self.add_error_log(

script_umdp3_checker/umdp3_conformance.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def print_results(self, print_volume: int = 3,
367367
"""Print results and return True if all checks passed.
368368
========================================================"""
369369
"""
370-
TODO: If an object encapsulating the data for each file is created"
370+
TODO: If an object encapsulating the data for each file is created
371371
it should contain the "in depth" printing method for file data.
372372
With this method presenting the summary and then looping over
373373
each file object to print its details at the desired verbosity."""
@@ -624,8 +624,9 @@ def get_files_to_check(path: str, full_check: bool,
624624
TODO : Uncertain as to how flexible this needs to be.
625625
For now, just configure checkers based on file type requested.
626626
Later, could add configuration files to specify which
627-
checkers to use for each file type.
628-
"""
627+
checkers to use for each file type."""
628+
checkers = []
629+
629630
active_checkers = create_style_checkers(args.file_types,
630631
full_file_paths)
631632

0 commit comments

Comments
 (0)