Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs label for markdown files #657

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bedevere/prtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
skirpichev marked this conversation as resolved.
Show resolved Hide resolved
docs = True
elif filepath.name.startswith(("test_", "_test")):
tests = True
Expand Down
2 changes: 1 addition & 1 deletion tests/test_prtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this test pass even without the changes in prtype.py?
The filenames include an .rst file, so the docs label should be applied regardless.
I would suggest to verify this, and possibly turn the list of filenames into a fixture.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this test pass even without the changes in prtype.py?

No. In this case classify_by_filepaths() will quickly return an empty list, walking over filenames (else branch).

issue = {"labels": [], "labels_url": "https://api.github.com/some/label"}
gh = FakeGH(getitem=issue)
event_data = {
Expand Down
Loading