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

feat: Add 'Custom' sort_type to CommitGroup #69

Merged
merged 1 commit into from Jan 9, 2021

Conversation

khos2ow
Copy link
Collaborator

@khos2ow khos2ow commented Apr 12, 2020

What does this do / why do we need it?

This PR adds a new Custom sorting type to CommitGroup. This gives the ability to organize and order the sections based on their priority rather than alphabetically. For example Feature has logical precedence over Bug Fixes in list of changes.

How this PR fixes the problem?

Now there's a dedicated configuration for it:

options:
  commit_groups:
    sort_by: Custom <-- required keyword 
    title_order:    <-- predefined ordered list of titles to apply sort with 
      - feat
      - fix
      - enhance
      - refactor
      - perf
      - docs
    title_maps:
      docs: Documentation
      enhance: Enhancements
      feat: Features
      fix: Bug Fixes
      perf: Performance Improvements
      refactor: Code Refactoring

What should your reviewer look out for in this PR?

The reason for adding a []string{} to hold the order is because in go all the map's keys get sorted for predictability so technically there's no way to depend on that, so I added a new property (title_order) which is a slice and the order does in fact get preserved.

Check lists

  • Test passed
  • Coding style (indentation, etc)

Additional Comments (if any)

n/a

Which issue(s) does this PR fix?

fixes #60

@coveralls
Copy link

coveralls commented Apr 12, 2020

Pull Request Test Coverage Report for Build 156

  • 26 of 26 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 75.276%

Totals Coverage Status
Change from base Build 155: 0.09%
Covered Lines: 1638
Relevant Lines: 2176

💛 - Coveralls

Copy link
Member

@mavogel mavogel left a comment

Choose a reason for hiding this comment

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

LGTM. Tested locally as I could not access the travis build

@mavogel mavogel merged commit 44f71cb into git-chglog:master Jan 9, 2021
@khos2ow
Copy link
Collaborator Author

khos2ow commented Jan 10, 2021

Yeah all these PRs are off of old travis which now seems to be in read-only mode to be migrated to travis-ci.com and we absolutely cannot do anything about them.

On top of that travis job on PRs are set to required and I couldn't merge one other PR. And I'm very curious how do you merge these now?

@khos2ow khos2ow deleted the custom-sort branch January 10, 2021 01:22
@mavogel
Copy link
Member

mavogel commented Jan 10, 2021

Yeah all these PRs are off of old travis which now seems to be in read-only mode to be migrated to travis-ci.com and we absolutely cannot do anything about them.

I get rid of travis in #87 and unlink it in the repo. There was an active webhook.

And I'm very curious how do you merge these now?

I can overrule this with the admin priviledes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wishlist: New sort_by type for commit groups
3 participants