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(commit): trim the trailing newline from message #403

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

vbx
Copy link
Contributor

@vbx vbx commented Dec 22, 2023

When the commit message ends with a '\n', then it is not considered a valid conventional commit. That's why the message must be cleaned up.

Description and Motivation and Context

Wrong next version when using the bumped-version parameter. The 'git commit' command creates a '\n' at the end of the line.
In this case, commit is considered as a patch.
https://github.com/MarcoIeni/release-plz/blob/4b0684ff8d9048032167a43fd70b70af4940239d/crates/next_version/src/next_version.rs#L27

    /// - If some commits are present, but none of them match conventional commits specification,
    ///   the version is incremented as a Patch.

How Has This Been Tested?

git cli command on linux/macos

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.

@vbx vbx requested a review from orhun as a code owner December 22, 2023 14:53
Copy link

welcome bot commented Dec 22, 2023

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

@orhun
Copy link
Owner

orhun commented Dec 22, 2023

Hey, thanks for the PR! 🐻

Do you think this might have side effects? It should be backwards compatible I reckon.

Also, looks like the formatting job has failed, can you run cargo fmt?

When the commit message ends with a '\n', then it is not considered a valid conventional commit. That's why the message must be cleaned up.
@vbx vbx force-pushed the vbx-cleanup-message-before-next-version-1 branch from 6e386a0 to 8084d09 Compare December 23, 2023 09:39
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2c524b8) 42.90% compared to head (8084d09) 42.90%.

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #403   +/-   ##
=======================================
  Coverage   42.90%   42.90%           
=======================================
  Files          13       13           
  Lines         690      690           
=======================================
  Hits          296      296           
  Misses        394      394           
Flag Coverage Δ
unit-tests 42.90% <100.00%> (ø)

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.

@vbx
Copy link
Contributor Author

vbx commented Dec 23, 2023

no side effects, i think. 'cargo fmt' is ok. i rebased branch also. PR is up to date.

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!

@orhun orhun changed the title fix: cleanup commit message fix(commit): trim the trailing newline from message Dec 23, 2023
@orhun orhun merged commit 514ca4b into orhun:main Dec 23, 2023
40 checks passed
Copy link

welcome bot commented Dec 23, 2023

Congrats on merging your first pull request! ⛰️

@nachtien
Copy link

nachtien commented Jan 3, 2024

nice work!

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.

4 participants