]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
add Flags.check_outbound_links
authorMarc Foley <m.foley.88@gmail.com>
Fri, 16 Feb 2024 12:05:45 +0000 (12:05 +0000)
committerMarc Foley <m.foley.88@gmail.com>
Mon, 19 Feb 2024 15:09:44 +0000 (15:09 +0000)
.github/workflows/ci.yaml
.github/workflows/knowledge_graph.py

index fc1f2af7200b047bc7b171e804878b6d1a1b3734..d39fe306c59b3a316be00c125791d07657104107 100644 (file)
@@ -38,4 +38,4 @@ jobs:
     - name: Install dependencies
       run: pip install absl-py mistune gftools
     - name: Check Knowledge graph
-      run: python3 .github/workflows/knowledge_graph.py
+      run: python3 .github/workflows/knowledge_graph.py --check_outbound_links
index 9ee755dbf7064d2449027ccd5391c5d5530f7ffa..c89cb4fa382f5616e18f4c23bef92219776a88c1 100644 (file)
@@ -68,6 +68,7 @@ FLAGS = flags.FLAGS
 
 
 flags.DEFINE_bool("print_valid", False, "Whether to print valid links")
+flags.DEFINE_bool("check_outbound_links", False, "Check outbound urls")
 
 
 MdValue = Union[Mapping[str, "MdValue"]]
@@ -222,7 +223,8 @@ def _check_md_files(knowledge: KnowledgeContent) -> bool:
             if not target:
                 continue  # TODO: are empty links bad
             if re.search("^http(s)?://", target.lower()):
-                result = _check_outbound_link(target) and result
+                if FLAGS.check_outbound_links:
+                    result = _check_outbound_link(target) and result
             else:
                 target_path = knowledge.link_target_to_path(target)
                 result = _check_file_present(knowledge.repo_root, md_file, target, target_path) and result