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: Fix IsValidMessage method adding a new exception for merge from master to the branch. #21

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v2.0.2:
- Fix IsValidMessage method adding a new exception for merge from master to the branch (@esequiel.virtuoso)

v2.0.1:
- Fix IsValidMessage method to skip commit lint when the message is a merge from master to a developer branch. (@esequiel.virtuoso)
- Add chore option. (@esequiel.virtuoso)
Expand Down
2 changes: 1 addition & 1 deletion src/commit-message/commit_message_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func isMergeMasterToBranch(message string) bool {
splitedMessage := strings.Split(strings.ToLower(message), "\n")

for _, row := range splitedMessage {
if strings.Contains(row, "'origin/master' into") {
if strings.Contains(row, "'origin/master' into") || strings.Contains(row, "merge branch 'master' into") {
return true
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/commit-message/commit_message_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ func TestIsValidMessageMergeMasterBranchSuccess(t *testing.T) {
message := "first message row \n Merge remote-tracking branch 'origin/master' into something \n last message row"
actual := f.commitMessageManager.IsValidMessage(message)
tests.AssertTrue(t, actual)

message = "first message row \n Merge branch 'master' into something \n last message row"
actual = f.commitMessageManager.IsValidMessage(message)
tests.AssertTrue(t, actual)
}
Loading