[core] Enable ruff BLE (flake8-blind-except) lint family (#16659)

This commit is contained in:
J. Nick Koston
2026-05-27 20:09:57 +12:00
committed by GitHub
parent 7463a15c7e
commit 3cc875c40b
23 changed files with 30 additions and 29 deletions
+3 -3
View File
@@ -128,7 +128,7 @@ def uses_local_file_references(component_dir: Path) -> bool:
try:
content = common_yaml.read_text()
except Exception: # pylint: disable=broad-exception-caught
except Exception: # noqa: BLE001 # pylint: disable=broad-exception-caught
return False
# Pattern to match $component_dir or ${component_dir} references
@@ -164,7 +164,7 @@ def is_platform_component(component_dir: Path) -> bool:
try:
content = comp_init.read_text()
return "IS_PLATFORM_COMPONENT = True" in content
except Exception: # pylint: disable=broad-exception-caught
except Exception: # noqa: BLE001 # pylint: disable=broad-exception-caught
return False
@@ -222,7 +222,7 @@ def analyze_yaml_file(yaml_file: Path) -> dict[str, Any]:
try:
data = yaml_util.load_yaml(yaml_file)
result["loaded"] = True
except Exception: # pylint: disable=broad-exception-caught
except Exception: # noqa: BLE001 # pylint: disable=broad-exception-caught
return result
# Check for Extend/Remove objects
+1 -1
View File
@@ -392,7 +392,7 @@ def compile_and_get_binary(
if exit_code != 0:
print(f"Error compiling {label} for {', '.join(components)}")
return exit_code, None
except Exception as e:
except Exception as e: # noqa: BLE001
print(f"Error compiling {label} for {', '.join(components)}: {e}")
return EXIT_COMPILE_ERROR, None
+1 -1
View File
@@ -312,7 +312,7 @@ def _is_clang_tidy_full_scan() -> bool:
)
# Exit 0 means hash changed (full scan needed)
return result.returncode == 0
except Exception:
except Exception: # noqa: BLE001
# If hash check fails, run full scan to be safe
return True
+1 -1
View File
@@ -437,7 +437,7 @@ def main() -> None:
tests_dir=args.tests_dir,
output_file=args.output,
)
except Exception as e:
except Exception as e: # noqa: BLE001
print(f"Error merging configs: {e}", file=sys.stderr)
import traceback
+1 -1
View File
@@ -21,7 +21,7 @@ async def connect_disconnect(client_id: int, iteration: int) -> tuple[int, bool,
await asyncio.wait_for(cli.connect(login=True), timeout=10)
await cli.disconnect()
return iteration, True, ""
except Exception as e:
except Exception as e: # noqa: BLE001
return (
iteration,
False,
+1 -1
View File
@@ -63,7 +63,7 @@ def test_component_group(
try:
result = subprocess.run(cmd, check=False)
return result.returncode == 0
except Exception as e:
except Exception as e: # noqa: BLE001
print(f"Error running test: {e}")
return False