Exemplo n.º 1
0
def check():
    if get_category() != "integration":
        print("Only integrations are checked.")
        return

    manifest = get_manifest()
    issues = []

    if manifest.get("domain") is None:
        issues.append("No domain")

    if manifest.get("documentation") is None:
        issues.append("No documentation")

    if manifest.get("issue_tracker") is None:
        issues.append("No issue_tracker")

    if manifest.get("codeowners") is None:
        issues.append("No codeowners")

    if manifest.get("homeassistant"):
        issues.append("homeassistant is not valid here")

    if issues:
        for issue in issues:
            print(issue)
        exit(1)
Exemplo n.º 2
0
async def check():
    if get_category() != "integration":
        print("Only integrations are checked.")
        return

    manifest = get_manifest()

    domain = manifest.get("domain")
    if domain is None:
        print("No domain")
        exit(1)

    async with GitHub(TOKEN) as github:
        repository = await github.get_repo("home-assistant/brands")
        files = await repository.get_contents("custom_integrations")
        if domain not in [x.attributes["name"] for x in files]:
            print(
                f"{domain} is not added to https://github.com/home-assistant/brands"
            )
            print(
                "This is needed to ensure the best possible experience for the user"
            )
            exit(1)
        else:
            print(
                f"{domain} is added to https://github.com/home-assistant/brands, NICE!"
            )
Exemplo n.º 3
0
def check():
    print("Information: https://hacs.xyz/docs/publish/include#check-manifest")
    if get_category() != "integration":
        print("Only integrations are checked.")
        return

    manifest = get_manifest()
    issues = []

    if manifest.get("domain") is None or manifest.get("domain") == "":
        issues.append("No domain")

    if manifest.get("documentation") is None or manifest.get("documentation") == "":
        issues.append("No documentation")

    if manifest.get("issue_tracker") is None or manifest.get("issue_tracker") == "":
        issues.append("No issue_tracker")

    if manifest.get("codeowners") is None:
        issues.append("No codeowners")

    if manifest.get("homeassistant"):
        issues.append("homeassistant is not valid here")

    if issues:
        for issue in issues:
            print(issue)
        exit(1)
Exemplo n.º 4
0
async def check():
    print("Information: https://hacs.xyz/docs/publish/include#check-brands")
    if get_category() != "integration":
       print("Only integrations are checked.")
       return

    manifest = get_manifest()
    domain = manifest.get("domain")

    if domain is None:
        print("No domain")
        exit(1)

    async with GitHub(TOKEN) as github:
        repository = await github.get_repo("home-assistant/brands")
        core = await repository.get_contents("core_integrations")
        custom = await repository.get_contents("custom_integrations")

        if domain not in [x.attributes["name"] for x in core + custom]:
            exit(
                f"::error::{domain} is not added to https://github.com/home-assistant/brands, "
                + "this is needed to ensure the best possible experience for the user"
            )
        else:
            print(
                f"{domain} is added to https://github.com/home-assistant/brands, NICE!"
            )
Exemplo n.º 5
0
def check():
    print("Information: https://hacs.xyz/docs/publish/include#check-manifest")
    if get_category() != "integration":
        print("Only integrations are checked.")
        return

    fail = "::error::Missing required value for key '{key}' in {path}"
    integration = get_integration_path()
    path = f"{integration.replace('/tmp/repositories/addition/', '')}/manifest.json"

    manifest = get_manifest()
    issues = []

    if manifest.get("domain") is None or manifest.get("domain") == "":
        issues.append(fail.format(key="domain", path=path))

    if manifest.get("documentation") is None or manifest.get("documentation") == "":
        issues.append(fail.format(key="documentation", path=path))

    if manifest.get("issue_tracker") is None or manifest.get("issue_tracker") == "":
        issues.append(fail.format(key="issue_tracker", path=path))

    if manifest.get("codeowners") is None:
        issues.append(fail.format(key="codeowners", path=path))

    if issues:
        for issue in issues:
            print(issue)
        exit(1)
Exemplo n.º 6
0
async def check():
    print("Information: https://hacs.xyz/docs/publish/include#check-wheels")
    if get_category() != "integration":
        print("Only integrations are checked.")
        return

    manifest = get_manifest()

    domain = manifest.get("domain")
    requirements = manifest.get("requirements")
    if domain is None:
        exit("No domain")

    if not requirements:
        print("No requirements found")
        return

    async with GitHub(TOKEN) as github:
        repository = await github.get_repo(
            "home-assistant/wheels-custom-integrations")
        files = await repository.get_contents("components")
        components = [x.attributes["name"] for x in files]
        if domain in components or f"{domain}.json" in components:
            print(
                f"{domain} is added to https://github.com/home-assistant/wheels-custom-integrations, NICE!"
            )
            return
        exit(
            f"::error::{domain} is not added to https://github.com/home-assistant/wheels-custom-integrations, "
            +
            "this is needed to ensure the best possible experience for the user"
        )
Exemplo n.º 7
0
def get_domain():
    manifest = get_manifest()
    return manifest.get("domain")