We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c580df commit d1afa18Copy full SHA for d1afa18
codespell_lib/_codespell.py
@@ -637,19 +637,14 @@ def build_dict(
637
if key in ignore_words:
638
continue
639
data = data.strip()
640
- fix = data.rfind(",")
641
642
- if fix < 0:
643
- fix = True
644
- reason = ""
645
- elif fix == (len(data) - 1):
646
- data = data[:fix]
647
+ if "," in data:
648
fix = False
+ data, reason = data.rsplit(",", 1)
+ reason = reason.lstrip()
649
else:
650
- reason = data[fix + 1 :].strip()
651
652
- fix = False
+ fix = True
+ reason = ""
653
654
misspellings[key] = Misspelling(data, fix, reason)
655
0 commit comments