-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove rST-specific code in snippets_test.py (#7085)
A regex in this file (on line 143) triggered a code scan security warning:(https://github.com/quantumlib/Cirq/security/code-scanning/97): ```python def find_rst_code_snippets(content: str) -> List[Tuple[str, int]]: snippets = find_code_snippets( r'\n.. code-block:: python\n(?:\s+:.*?\n)*\n(.*?)(?:\n\S|\Z)', content ``` > This part of the regular expression may cause exponential > backtracking on strings starting with '\naa code-block:: python\n :' > and containing many repetitions of '\n :'. This was in code for testing reStructuredText files. Since we no longer have any `.rst` files in the code base, it seemed more sensible to remove all the rST-specific code in here. Not only does that resolve the code scan warning; it also reduces the maintenance burden going forward.
- Loading branch information
Showing
1 changed file
with
2 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters