Random hassfest fixes (#23314)

This commit is contained in:
Paulus Schoutsen 2019-04-22 23:34:37 -07:00 committed by Martin Hjelmare
parent ddb5ff3b71
commit 00d26b3049
3 changed files with 9 additions and 7 deletions

View file

@ -35,10 +35,9 @@ def main():
integrations = Integration.load_dir( integrations = Integration.load_dir(
pathlib.Path('homeassistant/components') pathlib.Path('homeassistant/components')
) )
manifest.validate(integrations, config)
dependencies.validate(integrations, config) for plugin in PLUGINS:
codeowners.validate(integrations, config) plugin.validate(integrations, config)
services.validate(integrations, config)
# When we generate, all errors that are fixable will be ignored, # When we generate, all errors that are fixable will be ignored,
# as generating them will be fixed. # as generating them will be fixed.
@ -59,7 +58,10 @@ def main():
print("Invalid integrations:", len(invalid_itg)) print("Invalid integrations:", len(invalid_itg))
if not invalid_itg and not general_errors: 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 return 0
print() print()

View file

@ -68,5 +68,5 @@ def validate(integrations: Dict[str, Integration], config):
if dep not in integrations: if dep not in integrations:
integration.add_error( integration.add_error(
'dependencies', 'dependencies',
"Dependency {} does not exist" "Dependency {} does not exist".format(dep)
) )

View file

@ -59,7 +59,7 @@ def validate_services(integration: Integration):
"""Validate services.""" """Validate services."""
# Find if integration uses services # Find if integration uses services
has_services = grep_dir(integration.path, "**/*.py", has_services = grep_dir(integration.path, "**/*.py",
r"hass\.(services|async_register)") r"hass\.services\.(register|async_register)")
if not has_services: if not has_services:
return return