(
check_matches: list[Match[str]],
line: str,
word_regex: Pattern[str],
ignore_word_regex: Optional[Pattern[str]],
uri_regex: Pattern[str],
uri_ignore_words: set[str],
)
| 888 | |
| 889 | |
| 890 | def apply_uri_ignore_words( |
| 891 | check_matches: list[Match[str]], |
| 892 | line: str, |
| 893 | word_regex: Pattern[str], |
| 894 | ignore_word_regex: Optional[Pattern[str]], |
| 895 | uri_regex: Pattern[str], |
| 896 | uri_ignore_words: set[str], |
| 897 | ) -> list[Match[str]]: |
| 898 | if not uri_ignore_words: |
| 899 | return check_matches |
| 900 | for uri in uri_regex.findall(line): |
| 901 | for uri_word in extract_words(uri, word_regex, ignore_word_regex): |
| 902 | if uri_word in uri_ignore_words: |
| 903 | # determine/remove only the first among matches |
| 904 | for i, match in enumerate(check_matches): |
| 905 | if match.group() == uri_word: |
| 906 | check_matches = check_matches[:i] + check_matches[i + 1 :] |
| 907 | break |
| 908 | return check_matches |
| 909 | |
| 910 | |
| 911 | def _format_colored_output( |
no test coverage detected
searching dependent graphs…