Commit 22fef8fe69

22fef8fe69c80501f2fdbd1248fecdc8edba5b83

parent: d91840f418

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-07-20 12:09 UTC

Better handling of null/empty values

Layout: unified · split

lib/checks/check-pr-meta.py +1 −1
@@ -50,7 +50,7 @@ MISSING_TYPE_MSG = (
5050)
5151
5252_VALID_TYPES = re.compile(
53 r"addition|amendment|removal|spelling|grammar|website|lib|ci|api|misc|other",
53 r"addition|amendment|removal|spelling|grammar|website|scripts|lib|ci|api|misc|other",
5454 re.IGNORECASE,
5555)
5656
lib/checks/check-yaml-diff.py +3 −3
@@ -57,12 +57,12 @@ def write_github_output(name, value):
5757def find_duplicate_names(data):
5858 """Find duplicate service names within the same section."""
5959 duplicates = []
60 for cat in data.get("categories", []):
60 for cat in data.get("categories") or []:
6161 cn = cat.get("name", "")
62 for sec in cat.get("sections", []):
62 for sec in cat.get("sections") or []:
6363 sn = sec.get("name", "")
6464 seen = {}
65 for svc in sec.get("services", []):
65 for svc in sec.get("services") or []:
6666 name = svc.get("name", "")
6767 if name in seen:
6868 duplicates.append((cn, sn, name))
lib/checks/make-info-stats.py +2 −2
@@ -403,7 +403,7 @@ def grade_website_stats(data, url, has_security_txt):
403403
404404def fetch_android_data(package_id):
405405 """Fetch Android app privacy data."""
406 package_id = package_id.split("id=")[-1] if "id=" in package_id else package_id
406 package_id = (package_id.split("id=")[-1] if "id=" in package_id else package_id).split("&")[0]
407407 data = _enrich_get(f"android/{package_id}")
408408 return data if data and not data.get("error") else None
409409
@@ -450,7 +450,7 @@ def fetch_ios_data(app_url):
450450 """Fetch iOS app info, extracting the numeric id and country from the store URL."""
451451 if not app_url:
452452 return None
453 id_match = re.search(r"id(\d+)", app_url)
453 id_match = re.search(r"/id(\d+)", app_url)
454454 if not id_match:
455455 return None
456456 country_match = re.search(r"apps\.apple\.com/([a-z]{2})/", app_url)
lib/checks/prepare-comment.py +2 −2
@@ -50,7 +50,7 @@ def read_findings_count(new_body):
5050def _was_already_passing(existing_body):
5151 """Check if the most recent state in the comment is already all-clear."""
5252 # If there's a previous "all passing" edit, the last state was passing
53 if re.search(r"^(?:\*\*)?Edit(?: \d+)?(?:\*\*)?: (?:- )?All checks are (now passing|passing now)", existing_body, re.MULTILINE):
53 if re.search(r"^(?:\*\*)?Edit(?: \d+)?:(?:\*\*)? (?:- )?All checks are (now passing|passing now)", existing_body, re.MULTILINE):
5454 return True
5555 # If there are no edits at all, check the original comment body
5656 if not re.search(r"^(?:\*\*)?Edit(?: \d+)?(?:\*\*)?:", existing_body, re.MULTILINE):
@@ -61,7 +61,7 @@ def _was_already_passing(existing_body):
6161def _previous_failing_count(existing_body):
6262 """Extract the findings count from the most recent state in the comment."""
6363 # Check edit lines first (most recent state)
64 matches = re.findall(r"^(?:\*\*)?Edit(?: \d+)?(?:\*\*)?: (?:- )?(\d+) checks? (?:is|are) still failing", existing_body, re.MULTILINE)
64 matches = re.findall(r"^(?:\*\*)?Edit(?: \d+)?:(?:\*\*)? (?:- )?(?:\d+ issues? (?:was|were) resolved, but )?(\d+) checks? (?:is|are) still failing", existing_body, re.MULTILINE)
6565 if matches:
6666 return int(matches[-1])
6767 # No edits — count bullets in the original comment (before <details>)
lib/utils/data.py +1 −1
@@ -31,6 +31,6 @@ def slugify(title):
3131 if not title:
3232 return ""
3333 title = title.lower()
34 title = re.sub(r"\s", "-", title)
34 title = re.sub(r"\s+", "-", title)
3535 title = re.sub(r"[+&]", "and", title)
3636 return title.replace("?", "")