diff --git a/tests/checkers/rst_style.py b/tests/checkers/rst_style.py index c8ad549d8..050e57329 100644 --- a/tests/checkers/rst_style.py +++ b/tests/checkers/rst_style.py @@ -139,12 +139,13 @@ def check_early_line_breaks(file, lines, options=None): for lno, line in enumerate(lines): if lno + 1 < len(lines): next_line = lines[lno + 1] - if (is_valid_line(line, ('+', '|')) + if ( + is_valid_line(line, ('+', '|')) and is_valid_line(next_line, ('+', '|', '- ', '* ', '#. ')) ): - current_line_remaining_space = options.max_line_length - len(line) + current_line_remaining_space = options.max_line_length - len(line.rstrip()) next_line_first_word = get_next_line_first_word(next_line).rstrip() - if current_line_remaining_space > len(next_line_first_word): + if current_line_remaining_space >= len(next_line_first_word + ' '): yield lno + 1, f"consider moving \"{next_line_first_word}\" to line {lno + 1}"