Skip to content

Commit

Permalink
feat: Add link checker for documentation urls
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Jan 18, 2024
1 parent 4365d2e commit 78c7e1e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ckan_pkg_checker/checkers/link_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
TEST_LANDING_PAGE_URL = "dcat:landingPage"
TEST_PUBLISHER_URL = "dct:publisher"
TEST_CONFORMS_TO_URL = "dct:conformsTo"
TEST_DOCUMENTATION_URL = "foaf:page"
TEST_DOWNLOAD_URL = "dcat:downloadURL"
link_checks = [
TEST_ACCESS_URL,
Expand Down Expand Up @@ -119,7 +120,7 @@ def check_package(self, pkg):
if check_result:
check_results.append(check_result)

# Check conforms to URL
# Check conforms to URLs
if "conforms_to" in pkg:
for conforms_to_url in pkg["conforms_to"]:
if conforms_to_url:
Expand All @@ -129,6 +130,16 @@ def check_package(self, pkg):
if check_result:
check_results.append(check_result)

# Check documentation URLs
if "documentation" in pkg:
for documentation_url in pkg["documentation"]:
if documentation_url:
check_result = self._check_url_status(
TEST_CONFORMS_TO_URL, documentation_url
)
if check_result:
check_results.append(check_result)

for resource in pkg["resources"]:
log.info(
f"LINKCHECKER: checking RESOURCE: {utils.get_field_in_one_language(resource['display_name'], '')}"
Expand Down

0 comments on commit 78c7e1e

Please sign in to comment.