Skip to content

Commit 13ba99a

Browse files
committed
ENH: Improve readability of output
For comparison, here is an excerpt of the before and after output when running the tests with "python -m unittest discover -s tests" Before ------ Checking tests/example.h spell_check_file: tests/example.h, text/x-c++ Comment: Mary had a little lamb <class 'comment_parser.parsers.common.Comment'> Comment: <class 'comment_parser.parsers.common.Comment'> Comment: Prefix test words: <class 'comment_parser.parsers.common.Comment'> Comment: sitkBanana <class 'comment_parser.parsers.common.Comment'> Error: sitkBanana Trying without 'sitk' prefix: sitkBanana -> Banana Comment: vtkApple <class 'comment_parser.parsers.common.Comment'> After ----- Checking tests/example.h spell_check_file: tests/example.h, text/x-c++ Line 3: Mary had a little lamb Line 4: Line 5: Prefix test words: Line 6: sitkBanana Error: sitkBanana Trying without 'sitk' prefix: sitkBanana -> Banana Line 7: vtkApple Error: vtkApple Trying without 'vtk' prefix: vtkApple -> Apple
1 parent f1184d7 commit 13ba99a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

codespell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ def spell_check_comment(
9090
"""Check comment and return list of identified issues if any."""
9191

9292
if output_lvl > 1:
93-
print(f"Comment: {c}")
94-
print(type(c))
93+
print(f"Line {c.line_number()}: {c}")
9594

9695
mistakes = []
9796
spell_checker.set_text(c.text())

0 commit comments

Comments
 (0)