-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dbt task to check community_features doc for missing PR links (#3262
- Loading branch information
1 parent
f70949c
commit 40562f8
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import argparse | ||
import os | ||
from pathlib import Path | ||
import util | ||
import re | ||
|
||
COMMUNITY_FEATURES_DOC = Path("docs/community_features.md") | ||
|
||
|
||
def argparser() -> argparse.ArgumentParser: | ||
parser = argparse.ArgumentParser(prog="checkprdoc", description="Run deluge tests") | ||
parser.group = "Miscellaneous" | ||
return parser | ||
|
||
|
||
def main() -> int: | ||
(args, unknown_args) = argparser().parse_known_args() | ||
|
||
os.chdir(util.get_git_root()) | ||
|
||
with open(COMMUNITY_FEATURES_DOC, "r", encoding="utf-8") as file: | ||
content = file.read() | ||
|
||
# Find all PR references in the format [#1234] | ||
pr_numbers = re.findall(r"\[#(\d+)\][^:]", content) | ||
|
||
# Check if the corresponding PR links exist | ||
for pr_number in pr_numbers: | ||
if not re.search(rf"\[#{pr_number}\]: https", content): | ||
print( | ||
f"[#{pr_number}]: https://github.com/SynthstromAudible/DelugeFirmware/pull/{pr_number}" | ||
) | ||
|
||
exit(0) |