File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 53
53
__version__ as VERSION , # noqa: N812
54
54
)
55
55
56
- word_regex_def = r"\w[\w\-'’]*" # noqa: RUF001
56
+ # We do not care about single character words, and words should not
57
+ # have leading or trailing hyphens or apostrophes.
58
+ word_regex_def = r"\w[\w\-'’]*\w" # noqa: RUF001
57
59
# While we want to treat characters like ( or " as okay for a starting break,
58
60
# these may occur unescaped in URIs, and so we are more restrictive on the
59
61
# endpoint. Emails are more restrictive, so the endpoint remains flexible.
Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ def test_basic(
119
119
with fname .open ("w" ) as f : # overwrite the file
120
120
f .write ("var = 'nwe must check codespell likes escapes nin strings'\n " )
121
121
assert cs .main (fname ) == 2 , "checking our string escape test word is bad"
122
+ with fname .open ("w" ) as f : # overwrite the file
123
+ f .write ("fully 'nwe' quoted, or end nwe' quoted\n " )
124
+ assert cs .main (fname ) == 2 , "fully or end quoted should be detected"
122
125
# the first one is missed because the apostrophe means its not currently
123
126
# treated as a word on its own
124
127
with fname .open ("w" ) as f : # overwrite the file
You can’t perform that action at this time.
0 commit comments