fix(lint): resolve pylint and pyright issues on egress-log-option
- egress.py: extract _render_match_entry helper to reduce nesting depth - egress_addon_core.py: make request_method/request_headers keyword-only to satisfy too-many-positional-arguments; wrap long lazy import lines - egress_addon.py: remove unused Route import; add pylint disable for import-error on sidecar-only mitmproxy/egress_addon_core imports - dlp_detectors.py: remove dead _min_distance function (superseded by _closest_pair) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,22 +147,6 @@ JAILBREAK_PHRASES: tuple[re.Pattern[str], ...] = (
|
||||
PROXIMITY_CHARS = 500
|
||||
|
||||
|
||||
def _min_distance(
|
||||
a_matches: list[re.Match[str]],
|
||||
b_matches: list[re.Match[str]],
|
||||
) -> int | None:
|
||||
"""Smallest char distance between any pair of matches."""
|
||||
if not a_matches or not b_matches:
|
||||
return None
|
||||
best = None
|
||||
for a in a_matches:
|
||||
for b in b_matches:
|
||||
gap = max(0, max(a.start(), b.start()) - min(a.end(), b.end()))
|
||||
if best is None or gap < best:
|
||||
best = gap
|
||||
return best
|
||||
|
||||
|
||||
def _closest_pair(
|
||||
a_matches: list[re.Match[str]],
|
||||
b_matches: list[re.Match[str]],
|
||||
|
||||
Reference in New Issue
Block a user