-
Notifications
You must be signed in to change notification settings - Fork 122
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
Refactor issue_key function to sort issues in a human-friendly way #608
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good. Only minor comments.
Co-authored-by: Adi Roiban <adiroiban@gmail.com>
|
||
def test_ordering(self): | ||
""" | ||
Issues are ordered first by the non-text component, then by their number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess here "issues" means "news fragments"
Issues are ordered first by the non-text component, then by their number. | |
News fragments are ordered first by the non-text component, then by their number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
I left a few inline comments.
I think that part of my confusion is the use of the term "issue" in this PR.
I am not sure what an "issue" is: news fragment vs ticket ID
I think it helps to use consistent terminolgy across the code base and the documentation.
I am not a big fan of "news fragment" ... but this is what we have and I think that we should continue to use it.
Thanks again!
Co-authored-by: Adi Roiban <adiroiban@gmail.com>
for more information, see https://pre-commit.ci
@adiroiban I actually decided to switch to issue rather than ticket. My logic is it's the only term actually used in code and changing it for consistency would be backwards incompatible. We use the Even though it's not your preference, are you ok with using "issue" across the board instead of ticket? |
Thanks for the update
Sure. No problem. Your suggestion is much bettter. Happy to see some improvements here Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. All good!
…wisted#608) * Refactor issue_key function to sort issues in a human-friendly way * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename newsfragment * Small improvement to test to show how text with numeric issues are sorted * Update src/towncrier/_builder.py docstring grammar Co-authored-by: Adi Roiban <adiroiban@gmail.com> * clarify new behaviour in newsfragment * Add some docstrings/comments to tests * linelength fix * Clarify news fragments vs tickets Co-authored-by: Adi Roiban <adiroiban@gmail.com> * Consistent use of "issue" rather than "ticket" * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adi Roiban <adiroiban@gmail.com>
* Always content for orphans, since they don't have a concept of tickets * Add tests for orphans in non showcontent categories * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add newsfragment * Add a note in the configuration docs about the change to orphan fragments in non-showcontent categories * Use rst admonitions for the showcontent notes * Refactor rendering of title via `config.title_format` (#610) * Refactor rendering of title via config.title_format * Add newsfragment * Config docs * Fix restructuredtext formatting error * Refactor issue_key function to sort issues in a human-friendly way (#608) * Refactor issue_key function to sort issues in a human-friendly way * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename newsfragment * Small improvement to test to show how text with numeric issues are sorted * Update src/towncrier/_builder.py docstring grammar Co-authored-by: Adi Roiban <adiroiban@gmail.com> * clarify new behaviour in newsfragment * Add some docstrings/comments to tests * linelength fix * Clarify news fragments vs tickets Co-authored-by: Adi Roiban <adiroiban@gmail.com> * Consistent use of "issue" rather than "ticket" * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adi Roiban <adiroiban@gmail.com> * variable now called issue instead of ticket --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adi Roiban <adiroiban@gmail.com>
Description
In the issue key sorting method, there's this comment:
# Maybe we should sniff strings like "gh-10" -> (10, "gh-10")?
Let's do that.
To be more backwards compatible, we'll continue putting just plain numbers last. In reality, it's very unlikely a project is mixing issue types, but if they are, then they'll be grouped:
Checklist
src/towncrier/newsfragments/
. Describe yourchange and include important information. Your change will be included in the public release notes.