Closed arahusky closed 3 years ago
Hello Chris, I am working on Errant for Czech and found the following line problematic: https://github.com/chrisjbryant/errant/blob/6c0d521217f31177a359af7c11d96898a61e7c48/errant/en/merger.py#L64
The issue is that it is True even if start != 0 (if (len(c) == 1 and o[0].text[0].isupper()) gets evaluated to True.
(len(c) == 1 and o[0].text[0].isupper())
In such case, return on lines 66-67 will omit "the preceding part of combo".
I suppose that the fix is to enforce start == 0 by adding a pair of brackets:
if start == 0 and ((len(o) == 1 and c[0].text[0].isupper()) or \ (len(c) == 1 and o[0].text[0].isupper())):
Heya,
Thanks for the report! Looks like a bracketing issue indeed so I'll make a note to fix it in the next version.
Fixed in v2.3.0
Hello Chris, I am working on Errant for Czech and found the following line problematic: https://github.com/chrisjbryant/errant/blob/6c0d521217f31177a359af7c11d96898a61e7c48/errant/en/merger.py#L64
The issue is that it is True even if start != 0 (if
(len(c) == 1 and o[0].text[0].isupper())
gets evaluated to True.In such case, return on lines 66-67 will omit "the preceding part of combo".
I suppose that the fix is to enforce start == 0 by adding a pair of brackets: