From 894b5a97d782c3e00946cbb688345d84a61bfd02 Mon Sep 17 00:00:00 2001 From: Ari Leviatan Date: Mon, 14 Aug 2023 11:42:22 +0200 Subject: [PATCH] Increased result granularity in the URL validation --- pre_commit_hooks/check_preference_manifests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pre_commit_hooks/check_preference_manifests.py b/pre_commit_hooks/check_preference_manifests.py index 08cb2e6..2538912 100755 --- a/pre_commit_hooks/check_preference_manifests.py +++ b/pre_commit_hooks/check_preference_manifests.py @@ -324,7 +324,15 @@ def validate_urls(subkey, filename): url_keys = ("pfm_app_url", "pfm_documentation_url") for url_key in url_keys: if url_key in subkey: - if not subkey[url_key].startswith("http"): + if len(subkey[url_key]) == 0: + print( + "{}: {} URL value is empty.".format( + filename, + url_key, + ) + ) + passed = False + elif not subkey[url_key].startswith("http"): print( "{}: {} value doesn't look like a URL: {}".format( filename,