Skip to content

Commit d83b35b

Browse files
committed
ENH: Added Disable/Enable tag
Now putting "disable-spell-check" in a comment will temporarily disable spell checking. Use "enable-spell-check" in a comment to re-enable it.
1 parent 46c04d4 commit d83b35b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

comment_spell_check/comment_spell_check.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,21 @@ def spell_check_file(
268268
bad_words = []
269269
line_count = 0
270270

271+
disable_spell_check = False
272+
271273
for c in clist:
274+
if "spell-check-disable" in c.text().lower():
275+
disable_spell_check = True
276+
logger.info(" Spell checking disabled")
277+
continue
278+
279+
if "spell-check-enable" in c.text().lower():
280+
disable_spell_check = False
281+
logger.info(" Spell checking enabled")
282+
283+
if disable_spell_check:
284+
continue
285+
272286
mistakes = spell_check_comment(spell_checker, c, prefixes=prefixes)
273287
if len(mistakes) > 0:
274288
logger.info("\nLine number %s", c.line_number())

0 commit comments

Comments
 (0)