ci: fix docs checker for wiki based docs (#27380)

(cherry picked from commit 5596988c94)

# Conflicts:
#	.github/helper/documentation.py
This commit is contained in:
Ankush Menat
2021-09-07 14:53:30 +05:30
committed by Mergify
parent f5160dc83d
commit 4917e9d6b3

View File

@@ -14,6 +14,7 @@ DOCUMENTATION_DOMAINS = [
]
<<<<<<< HEAD
def is_valid_url(url: str) -> bool:
parts = urlparse(url)
return all((parts.scheme, parts.netloc, parts.path))
@@ -65,6 +66,19 @@ def check_pull_request(number: str) -> "tuple[int, str]":
return 0, "Documentation Link Found. You're Awesome! 🎉"
return 1, "Documentation Link Not Found! ⚠️"
=======
def docs_link_exists(body):
for line in body.splitlines():
for word in line.split():
if word.startswith('http') and uri_validator(word):
parsed_url = urlparse(word)
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split('/')
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in docs_repos:
return True
elif parsed_url.netloc == "docs.erpnext.com":
return True
>>>>>>> 5596988c94 (ci: fix docs checker for wiki based docs (#27380))
if __name__ == "__main__":