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(config): add field and value matchers to the commit parser #312

Merged
merged 8 commits into from
Oct 15, 2023
Merged

feat(config): add field and value matchers to the commit parser #312

merged 8 commits into from
Oct 15, 2023

Conversation

dpecos
Copy link
Contributor

@dpecos dpecos commented Oct 11, 2023

Description

This PR introduces the capability of grouping commits by attributes of the commit, i.e. author.name or author.email.

Motivation and Context

This changeset should cover the scenario described in #194.

The reporter of that issue wanted to create a new group based gathering the commits for a specific author name:

 { author.name = "Renovate Bot", group = "Dependency Updates"},

How Has This Been Tested?

In order to test it works, I've modified the cliff.toml file in this project to include a new group like this:

commit_parsers = [
  { field = "author.name", pattern="dependabot\\[bot\\]", group = "Dependency Updates"},
  ...

which generates the following new group:

### Dependency Updates

- *(deps)* Bump regex from 1.9.6 to 1.10.0 ([#308](https://github.com/orhun/git-cliff/issues/308)) - ([a6a890a](https://github.com/orhun/git-cliff/commit/a6a890ac4f0051518b4b4c0d65a5ce83ae0de1c8))
- *(deps)* Bump toml from 0.8.1 to 0.8.2 ([#306](https://github.com/orhun/git-cliff/issues/306)) - ([8422096](https://github.com/orhun/git-cliff/commit/8422096549320604643cda9baab4190a5de272fb))
- *(deps)* Bump regex from 1.9.5 to 1.9.6 ([#305](https://github.com/orhun/git-cliff/issues/305)) - ([e263163](https://github.com/orhun/git-cliff/commit/e2631639bf0438fb8f67e3b99c27354fd7409f57))

Screenshots / Logs (if applicable)

image

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dpecos dpecos requested a review from orhun as a code owner October 11, 2023 10:30
@welcome
Copy link

welcome bot commented Oct 11, 2023

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
git-cliff-core/src/changelog.rs 55.67% <ø> (ø)
git-cliff-core/src/config.rs 41.67% <ø> (ø)
git-cliff-core/src/commit.rs 90.67% <60.00%> (-4.88%) ⬇️

📢 Thoughts on this report? Let us know!.

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution! Just had some suggestions for improving the code.

website/docs/configuration.md Outdated Show resolved Hide resolved
website/docs/configuration.md Outdated Show resolved Hide resolved
git-cliff-core/src/config.rs Outdated Show resolved Hide resolved
git-cliff-core/src/commit.rs Outdated Show resolved Hide resolved
@orhun
Copy link
Owner

orhun commented Oct 13, 2023

Also, can you resolve the conflicts with main?

dpecos and others added 5 commits October 15, 2023 12:27
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
@dpecos dpecos requested a review from orhun October 15, 2023 10:50
@dpecos
Copy link
Contributor Author

dpecos commented Oct 15, 2023

Suggestions applied (btw, I really like the refactor for the big switch case I had) and changes from main pulled :-)

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for your contribution!

It was really fun working with you at the EuroRust workshop @dpecos! Wish to see you in the future events/open source projects. ❤️

@orhun orhun changed the title feat(config): add field and value matchers to commit parser (#194) feat(config): add field and value matchers to the commit parser Oct 15, 2023
@orhun orhun merged commit 04fbcb8 into orhun:main Oct 15, 2023
23 checks passed
@welcome
Copy link

welcome bot commented Oct 15, 2023

Congrats on merging your first pull request! ⛰️

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.

3 participants