Skip to content

Commit 91ec622

Browse files
jcfrjhlegarreta
andcommitted
STYLE: Introduce constant to list checked contractions
This is a follow-up of 4fcf562 (ENH: Generalize handling of contractions like "'d", "'s" or "'th") Co-authored-by: Jon Haitz Legarreta Gorroño <jon.haitz.legarreta@gmail.com>
1 parent 65d081a commit 91ec622

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

codespell.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
}
3838

3939

40+
CONTRACTIONS = ["'d", "'s", "'th"]
41+
42+
4043
def splitCamelCase(word):
4144
"""Split a camel case string into individual words."""
4245

@@ -112,7 +115,7 @@ def spell_check_comment(
112115
valid = False
113116

114117
# Check for contractions
115-
for contraction in ["'d", "'s", "'th"]:
118+
for contraction in CONTRACTIONS:
116119
if error_word.endswith(contraction):
117120
original_error_word = error_word
118121
error_word = error_word[: -len(contraction)]

0 commit comments

Comments
 (0)