Refactor: reformat all code for lefthook using ruff and gofmt (#16585)

This commit is contained in:
Wang Qi
2026-07-03 12:53:39 +08:00
committed by GitHub
parent 19fcb4a981
commit 6a4b9be426
588 changed files with 11123 additions and 15412 deletions
+2 -8
View File
@@ -39,20 +39,14 @@ def _restore_common_data_source_package() -> None:
return
if not isinstance(mod, types.ModuleType) or not getattr(mod, "__path__", None):
return
keys = [
key
for key in sys.modules
if key == "common.data_source" or key.startswith("common.data_source.")
]
keys = [key for key in sys.modules if key == "common.data_source" or key.startswith("common.data_source.")]
for key in keys:
del sys.modules[key]
importlib.invalidate_caches()
try:
importlib.import_module("common.data_source")
except Exception as exc: # pragma: no cover
raise ImportError(
"conftest: failed to restore real common.data_source package"
) from exc
raise ImportError("conftest: failed to restore real common.data_source package") from exc
_restore_common_data_source_package()