From 84353509f07d004010659311df5e65b9ce43e46a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 13:25:18 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fix_snapshot.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/fix_snapshot.py b/fix_snapshot.py index 8d46502816..c514c23404 100644 --- a/fix_snapshot.py +++ b/fix_snapshot.py @@ -1,10 +1,8 @@ #!/usr/bin/env python3 """Remove the old snapshot dictionary from test_include_router_defaults_overrides.py""" -import re - # Read the file -with open('tests/test_include_router_defaults_overrides.py', 'r') as f: +with open("tests/test_include_router_defaults_overrides.py") as f: lines = f.readlines() # Find and remove the old snapshot dictionary @@ -13,27 +11,27 @@ i = 0 while i < len(lines): line = lines[i] new_lines.append(line) - + # If we hit operation_ids.add(op_id), the next non-empty line should be the start of the snapshot dict - if 'operation_ids.add(op_id)' in line: + if "operation_ids.add(op_id)" in line: # Skip all lines until we find the closing paren of snapshot() i += 1 brace_count = 0 while i < len(lines): cur_line = lines[i] - brace_count += cur_line.count('{') - cur_line.count('}') - + brace_count += cur_line.count("{") - cur_line.count("}") + # Check if this is the closing paren of snapshot() - if brace_count == 0 and cur_line.strip() == ')': + if brace_count == 0 and cur_line.strip() == ")": i += 1 break i += 1 continue - + i += 1 # Write back -with open('tests/test_include_router_defaults_overrides.py', 'w') as f: +with open("tests/test_include_router_defaults_overrides.py", "w") as f: f.writelines(new_lines) print("Done! Removed snapshot dictionary")