Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Oct 12, 2023
1 parent a901d6a commit e3515d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sphinxlint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PER_FILE_CACHES = []


def _per_file_cache(func):
def per_file_cache(func):
memoized_func = lru_cache(maxsize=None)(func)
PER_FILE_CACHES.append(memoized_func)
return memoized_func
Expand Down Expand Up @@ -38,7 +38,7 @@ def _clean_heuristic(paragraph, regex):
paragraph = paragraph[: candidate.start()] + paragraph[candidate.end() :]


@_per_file_cache
@per_file_cache
def clean_paragraph(paragraph):
"""Removes all good constructs, so detectors can focus on bad ones.
Expand All @@ -54,7 +54,7 @@ def clean_paragraph(paragraph):
return paragraph.replace("\x00", "\\")


@_per_file_cache
@per_file_cache
def escape2null(text):
r"""Return a string with escape-backslashes converted to nulls.
Expand Down Expand Up @@ -88,7 +88,7 @@ def escape2null(text):
start = found + 2 # skip character after escape


@_per_file_cache
@per_file_cache
def paragraphs(lines):
"""Yield (paragraph_line_no, paragraph_text) pairs describing
paragraphs of the given lines.
Expand Down Expand Up @@ -216,7 +216,7 @@ def hide_non_rst_blocks(lines, hidden_block_cb=None):
_starts_with_substitution_definition = re.compile(r"\.\. \|[^\|]*\| ").match


@_per_file_cache
@per_file_cache
def type_of_explicit_markup(line):
"""Tell apart various explicit markup blocks."""
line = line.lstrip()
Expand Down

0 comments on commit e3515d9

Please sign in to comment.