Skip to content

Commit de3bce8

Browse files
authored
Merge pull request #105 from tannewt/fix_doc_check
Fix driver doc check to find url with - instead of _
2 parents d2ba58d + 4a4aa67 commit de3bce8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adabot/lib/circuitpython_library_validators.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,11 @@ def validate_contents(self, repo):
439439
return []
440440

441441
content_list = github.get("/repos/" + repo["full_name"] + "/contents/")
442-
if not content_list.ok:
442+
# Empty repos return an object with a "message" that the repo is empty.
443+
if not content_list.ok or "message" in content_list.json():
443444
if not self.validate_contents_quiet:
444445
return [ERROR_UNABLE_PULL_REPO_CONTENTS]
446+
return []
445447

446448
content_list = content_list.json()
447449
files = [x["name"] for x in content_list]
@@ -741,7 +743,9 @@ def validate_core_driver_page(self, repo):
741743
core_driver_page = driver_page.text
742744

743745
repo_short_name = repo["name"][len("Adafruit_CircuitPython_"):].lower()
744-
if "https://circuitpython.readthedocs.io/projects/" + repo_short_name + "/en/latest/" not in core_driver_page:
746+
full_url = "https://circuitpython.readthedocs.io/projects/" + repo_short_name + "/en/latest/"
747+
full_url_dashes = full_url.replace("_", "-")
748+
if full_url not in core_driver_page and full_url_dashes not in core_driver_page:
745749
return [ERROR_DRIVERS_PAGE_DOWNLOAD_MISSING_DRIVER]
746750
return []
747751

0 commit comments

Comments
 (0)