Skip to content

Refactor Category to be Labels - #486

Merged
ezio-melotti merged 5 commits into
python:mainfrom
DanielNoord:labels
Jul 11, 2022
Merged

Refactor Category to be Labels#486
ezio-melotti merged 5 commits into
python:mainfrom
DanielNoord:labels

Conversation

@DanielNoord

Copy link
Copy Markdown
Contributor

Refactor as requested by @ezio-melotti in #485 (comment).

Also couldn't help but notice the unused import so I removed it in a separate commit. If that's undesired I'll revert that change obviously!

@codecov

codecovBot commented Jul 7, 2022

Copy link
Copy Markdown

Codecov Report

Merging #486 (4ea7afb) into main (6aebdb4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## main #486 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 18 18 Lines 1815 1815 Branches 220 220 =========================================
Hits 1815 1815 
FlagCoverage Δ
Python_3.10100.00% <100.00%> (ø)
Python_3.11-dev100.00% <100.00%> (ø)
Python_3.8100.00% <100.00%> (ø)
Python_3.9100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted FilesCoverage Δ
bedevere/prtype.py100.00% <100.00%> (ø)
tests/test_filepaths.py100.00% <100.00%> (ø)
tests/test_prtype.py100.00% <100.00%> (ø)

@ezio-melottiezio-melotti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I left a few minor comments but otherwise looks good to me.

However I'm a bit confused:

  • the module docstring says "Label a pull request based on its type"
  • the enum docstring talks about labels for PRs

but:

  • classify_by_filepaths below calls util.issue_for_PR to retrieve the issue
  • add_label/add_category accept an issue and label it

It would appear that is the issue being labeled, and if that's indeed the case, then the module docstring and the enum docstrings should be updated. (I think it's fine doing it in this PR.)

Comment threadbedevere/prtype.py Outdated
Comment threadbedevere/prtype.py Outdated
Comment threadbedevere/prtype.py
@DanielNoord

Copy link
Copy Markdown
ContributorAuthor
  • the module docstring says "Label a pull request based on its type"
  • the enum docstring talks about labels for PRs

but:

  • classify_by_filepaths below calls util.issue_for_PR to retrieve the issue
  • add_label/add_category accept an issue and label it

I'm not sure about the gh.post method, but as I see it gh gets labeled (which is the PR) and the issue is being used to retrieve some data about the PR and its related issue.

So I think the current docstrings are actually correct. But somebody with more knowledge about the gh.post method can probably confirm this 100%.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@DanielNoord@ezio-melotti