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(parser): support using regex scope values #372

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

orhun
Copy link
Owner

@orhun orhun commented Dec 7, 2023

Description

This PR makes it possible to use regex-replace for the scope value in commit_parsers:

[git]
# regex for parsing and grouping commits
commit_parsers = [
  { message = "^\\[(.*)\\]", group = "Changes to ${1}", scope = "${1}" },
]

In this example, [codebase]: rewrite everything in Rust will appear in the changelog as:

### Changes to codebase

- (codebase) Rewrite everything in Rust

Motivation and Context

closes #371

How Has This Been Tested?

test fixtures

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.

@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (991a035) 42.65% compared to head (268b71a) 42.73%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #372      +/-   ##
==========================================
+ Coverage   42.65%   42.73%   +0.09%     
==========================================
  Files          13       13              
  Lines         666      667       +1     
==========================================
+ Hits          284      285       +1     
  Misses        382      382              
Flag Coverage Δ
unit-tests 42.73% <100.00%> (+0.09%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orhun orhun merged commit 19e65c2 into main Dec 7, 2023
27 of 28 checks passed
@orhun orhun changed the title Support using regex scope values feat(parser): support using regex scope values Dec 7, 2023
@orhun orhun deleted the feat/replace_scope_with_regex branch December 7, 2023 18:25
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.

CommitParser, Regex Capture group not resolved in scope
2 participants