From 7aab52eeaf8191acdaf71ac0db7ada75a5d8d591 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 7 Dec 2024 02:49:41 +0300 Subject: [PATCH 1/3] Add docs label for *.md files Closes #656 --- bedevere/prtype.py | 2 +- tests/test_prtype.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bedevere/prtype.py b/bedevere/prtype.py index 8f58a1cf..6bae77a5 100644 --- a/bedevere/prtype.py +++ b/bedevere/prtype.py @@ -43,7 +43,7 @@ async def classify_by_filepaths(gh, pull_request, filenames): if util.is_news_dir(filename): news = True filepath = pathlib.PurePath(filename) - if filepath.suffix == ".rst" or filepath.name == ".nitignore": + if filepath.suffix in [".rst", ".md"] or filepath.name == ".nitignore": docs = True elif filepath.name.startswith(("test_", "_test")): tests = True diff --git a/tests/test_prtype.py b/tests/test_prtype.py index 8cb76da2..158b97d4 100644 --- a/tests/test_prtype.py +++ b/tests/test_prtype.py @@ -66,7 +66,7 @@ async def test_news_only(): async def test_docs_no_news(): - filenames = {"path/to/docs1.rst"} + filenames = {"path/to/docs1.rst", "other/path/to/docs2.md"} issue = {"labels": [], "labels_url": "https://api.github.com/some/label"} gh = FakeGH(getitem=issue) event_data = { From b3977b47b30abc3b6d9d7d1f3defdf09b7eb6da7 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 7 Dec 2024 12:00:52 +0300 Subject: [PATCH 2/3] Update bedevere/prtype.py Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- bedevere/prtype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bedevere/prtype.py b/bedevere/prtype.py index 6bae77a5..e674a6c8 100644 --- a/bedevere/prtype.py +++ b/bedevere/prtype.py @@ -43,7 +43,7 @@ async def classify_by_filepaths(gh, pull_request, filenames): if util.is_news_dir(filename): news = True filepath = pathlib.PurePath(filename) - if filepath.suffix in [".rst", ".md"] or filepath.name == ".nitignore": + if filepath.suffix in [".md", ".rst"] or filepath.name == ".nitignore": docs = True elif filepath.name.startswith(("test_", "_test")): tests = True From f2c98b64c76329e9c84f30d870906ce031ed618c Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 8 Dec 2024 08:04:23 +0300 Subject: [PATCH 3/3] Update bedevere/prtype.py Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- bedevere/prtype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bedevere/prtype.py b/bedevere/prtype.py index e674a6c8..5136c74a 100644 --- a/bedevere/prtype.py +++ b/bedevere/prtype.py @@ -43,7 +43,7 @@ async def classify_by_filepaths(gh, pull_request, filenames): if util.is_news_dir(filename): news = True filepath = pathlib.PurePath(filename) - if filepath.suffix in [".md", ".rst"] or filepath.name == ".nitignore": + if filepath.suffix in {".md", ".rst"} or filepath.name == ".nitignore": docs = True elif filepath.name.startswith(("test_", "_test")): tests = True