Skip to content

Commit

Permalink
Merge pull request #3 from dave3d/AllowStandalonePrefixes
Browse files Browse the repository at this point in the history
OK if a word == a prefix
  • Loading branch information
dave3d authored Dec 11, 2020
2 parents 92ea09b + 0645ea4 commit 3d189cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def spell_check_file(filename, spell_checker, mimetype='',
#
for pre in prefixes:
if error.word.startswith(pre):

# check if the word is only the prefix
if len(pre) == len(error.word):
continue

# remove the prefix
wrd = error.word[len(pre):]
if output_lvl > 1:
print("Trying without prefix: ", error.word, wrd)
Expand Down

0 comments on commit 3d189cd

Please sign in to comment.