Skip to content

Commit c6e81e4

Browse files
committed
Rename _PATTERN to _RE
The latter seems to be what the current codebase calls Pattern objects, so let's not add confusion. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
1 parent 0867edc commit c6e81e4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sphinxlint/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@ def looks_like_glued(match):
121121
return True
122122

123123

124-
_START_OF_COMMENT_BLOCK_PATTERN = re.compile(r"^\s*\.\.$")
125-
_PRODUCTION_LIST_DIRECTIVE_PATTERN = re.compile(r"^ *.. productionlist::")
126-
_COMMENT_PATTERN = re.compile(r"^ *\.\. ")
124+
_START_OF_COMMENT_BLOCK_RE = re.compile(r"^\s*\.\.$")
125+
_PRODUCTION_LIST_DIRECTIVE_RE = re.compile(r"^ *.. productionlist::")
126+
_COMMENT_RE = re.compile(r"^ *\.\. ")
127127

128128

129129
def is_multiline_non_rst_block(line):
130130
"""Returns True if the next lines are an indented literal block."""
131-
if _START_OF_COMMENT_BLOCK_PATTERN.search(line):
131+
if _START_OF_COMMENT_BLOCK_RE.search(line):
132132
return True
133133
if rst.DIRECTIVES_CONTAINING_RST_RE.match(line):
134134
return False
135135
if rst.DIRECTIVES_CONTAINING_ARBITRARY_CONTENT_RE.match(line):
136136
return True
137-
if _PRODUCTION_LIST_DIRECTIVE_PATTERN.search(line):
137+
if _PRODUCTION_LIST_DIRECTIVE_RE.search(line):
138138
return True
139-
if _COMMENT_PATTERN.search(line) and type_of_explicit_markup(line) == "comment":
139+
if _COMMENT_RE.search(line) and type_of_explicit_markup(line) == "comment":
140140
return True
141141
if line.endswith("::\n"): # It's a literal block
142142
return True
@@ -169,7 +169,7 @@ def hide_non_rst_blocks(lines, hidden_block_cb=None):
169169
block_line_start = lineno
170170
assert not excluded_lines
171171
if (
172-
_COMMENT_PATTERN.search(line)
172+
_COMMENT_RE.search(line)
173173
and type_of_explicit_markup(line) == "comment"
174174
):
175175
line = "\n"

0 commit comments

Comments
 (0)