From 00d26b304984aa953bf5cc6fe2ca21953d86c9b0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 22 Apr 2019 23:34:37 -0700 Subject: [PATCH] Random hassfest fixes (#23314) --- script/hassfest/__main__.py | 12 +++++++----- script/hassfest/dependencies.py | 2 +- script/hassfest/services.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/script/hassfest/__main__.py b/script/hassfest/__main__.py index b555f98d883..bca419126db 100644 --- a/script/hassfest/__main__.py +++ b/script/hassfest/__main__.py @@ -35,10 +35,9 @@ def main(): integrations = Integration.load_dir( pathlib.Path('homeassistant/components') ) - manifest.validate(integrations, config) - dependencies.validate(integrations, config) - codeowners.validate(integrations, config) - services.validate(integrations, config) + + for plugin in PLUGINS: + plugin.validate(integrations, config) # When we generate, all errors that are fixable will be ignored, # as generating them will be fixed. @@ -59,7 +58,10 @@ def main(): print("Invalid integrations:", len(invalid_itg)) if not invalid_itg and not general_errors: - codeowners.generate(integrations, config) + for plugin in PLUGINS: + if hasattr(plugin, 'generate'): + plugin.generate(integrations, config) + return 0 print() diff --git a/script/hassfest/dependencies.py b/script/hassfest/dependencies.py index 25553be1124..f0f14ad21a4 100644 --- a/script/hassfest/dependencies.py +++ b/script/hassfest/dependencies.py @@ -68,5 +68,5 @@ def validate(integrations: Dict[str, Integration], config): if dep not in integrations: integration.add_error( 'dependencies', - "Dependency {} does not exist" + "Dependency {} does not exist".format(dep) ) diff --git a/script/hassfest/services.py b/script/hassfest/services.py index 4be366b3d55..8750f9a6982 100644 --- a/script/hassfest/services.py +++ b/script/hassfest/services.py @@ -59,7 +59,7 @@ def validate_services(integration: Integration): """Validate services.""" # Find if integration uses services has_services = grep_dir(integration.path, "**/*.py", - r"hass\.(services|async_register)") + r"hass\.services\.(register|async_register)") if not has_services: return