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

fix(changelog): ignore empty lines when using split_commits #608

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

AntoineGS
Copy link
Contributor

@AntoineGS AntoineGS commented Apr 12, 2024

Description

Prevent duplication of changelog when using split_commit and the commits have empty lines.

Motivation and Context

When using split commits, if there is a an empty line between commits, it will duplicate the commit prior to the empty line, and I noticed that it will sometimes assign it to a different scope, though I have not investigated the why at this point.
One of the reasons this is a problem is that in certain GUIs (like GitHub Desktop) if you enter the first line in the header and the second line in the body, it will automatically add a new line.
fixes #606

How Has This Been Tested?

Using the existing test (changelog_generator_split_commits) by adding a new line in one of the commits.

Screenshots / Logs (if applicable)

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.

@AntoineGS AntoineGS requested a review from orhun as a code owner April 12, 2024 16:50
Copy link

welcome bot commented Apr 12, 2024

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

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.38%. Comparing base (c7001e9) to head (060c84d).
Report is 1 commits behind head on main.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #608      +/-   ##
==========================================
+ Coverage   41.27%   41.38%   +0.11%     
==========================================
  Files          15       15              
  Lines        1071     1073       +2     
==========================================
+ Hits          442      444       +2     
  Misses        629      629              
Flag Coverage Δ
unit-tests 41.38% <100.00%> (+0.11%) ⬆️

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.

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.

Perfect, thank you! 🐻

@orhun orhun changed the title fix: ignore empty lines when using split_commits fix(changelog): ignore empty lines when using split_commits Apr 12, 2024
@orhun orhun merged commit b8fb852 into orhun:main Apr 12, 2024
44 checks passed
Copy link

welcome bot commented Apr 12, 2024

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.

split_commits with new lines create duplicate entries
3 participants