Skip to content

Add services.yaml validator#23205

Merged
balloob merged 2 commits into
devfrom
services-validator
Apr 18, 2019
Merged

Add services.yaml validator#23205
balloob merged 2 commits into
devfrom
services-validator

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Apr 18, 2019

Description:

Add validator for services.yaml.

Currently only a warning to not have a services.yaml while registering it, will await this wave of services.yaml PRs, then I will add stub files for it all.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly (example).
  • New dependencies have been added to requirements in the manifest (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob balloob merged commit 33b8241 into dev Apr 18, 2019
@delete-merged-branch delete-merged-branch Bot deleted the services-validator branch April 18, 2019 20:40
@balloob balloob added this to the 0.92.0 milestone Apr 18, 2019
@@ -0,0 +1,104 @@
"""Validate dependencies."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale docstring.

data = load_yaml(str(integration.path / 'services.yaml'))
except FileNotFoundError:
print(
"Warning: {} registeres services but has no services.yaml".format(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registers


validate_services(integration)

# check that all referenced dependencies exist
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do this here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oh. Too fast copy paste before I had to leave. Will fix.

balloob added a commit that referenced this pull request Apr 20, 2019
* Add services.yaml validator

* Fix path
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Add services.yaml validator

* Fix path
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Add services.yaml validator

* Fix path
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Add services.yaml validator

* Fix path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants