Skip to content

Commit 44ba12e

Browse files
authored
Speed up spellchecking by ignoring whitespace-only lines (#3722)
1 parent 73b7b5e commit 44ba12e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

codespell_lib/_codespell.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,8 @@ def parse_file(
946946
return bad_count
947947

948948
for i, line in enumerate(lines):
949-
if line.rstrip() in exclude_lines:
949+
line = line.rstrip()
950+
if not line or line in exclude_lines:
950951
continue
951952

952953
extra_words_to_ignore = set()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ allow-magic-value-types = ["bytes", "int", "str",]
173173
max-args = 13
174174
max-branches = 48
175175
max-returns = 12
176-
max-statements = 119
176+
max-statements = 120

0 commit comments

Comments
 (0)