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)
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!" )
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!" )
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)
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)
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" )
def check(): print("Information: https://hacs.xyz/docs/publish/include#check-images") if get_category() not in ["plugin", "theme"]: print("Only plugin and theme are checked.") return info = get_info() if "<img" in info or "![" in info: print("Has image(s)") return exit("::error::There should be images to show the user what they get.")
def check(): if get_category() not in ["plugin", "theme"]: print("Only plugin and theme are checked.") return info = get_info() if "<img" in info or "![" in info: print("Has image(s)") return print("There should be images to show the user what they get.") exit(1)
def check(): if get_category() != "integration": print("Only integrations are checked.") return manifest = get_hacs_manifest() issues = [] if manifest.get("name") is None: issues.append("No name") if issues: for issue in issues: print(issue) exit(1)
def get_repo(): category = get_category() with open(f"{DEFAULT}/{category}", "r") as default: current = json.loads(default.read()) with open(category, "r") as default: new = json.loads(default.read()) for repo in current: if repo in new: new.remove(repo) if len(new) != 1: print(f"Bad data {new}") exit(1) return new.pop()
def check(): print( "Information: https://hacs.xyz/docs/publish/include#check-hacs-manifest" ) if get_category() != "integration": print("Only integrations are checked.") return manifest = get_hacs_manifest() issues = [] if manifest.get("name") is None: issues.append("No name") if issues: for issue in issues: print(issue) exit(1)
def check(): print( "Information: https://hacs.xyz/docs/publish/include#check-hacs-manifest" ) if get_category() != "integration": print("Only integrations are checked.") return manifest = get_hacs_manifest() fail = "::error::Missing required value for key '{key}' in {path}" path = "hacs.json" issues = [] if manifest.get("name") is None: issues.append(fail.format(key="name", path=path)) if issues: for issue in issues: print(issue) exit(1)