Skip to content

Commit

Permalink
fix(conventionalcommits): Update Commit Determination Functionality
Browse files Browse the repository at this point in the history
* Refactor 'DetermineIncrementType' function to improve readability
* Adjust 'determinateCommonChangeType' function to handle new types
* Rearrange and rename variables for better organization
* Add comments for improved code understanding

This commit updates the functionality of the 'DetermineIncrementType' and 'determinateCommonChangeType' functions in the conventionalcommits package. The changes aim to improve readability, organize variables better, and add comments for enhanced understanding of the code. Additionally, the function to determine common change types has been updated to handle new types that may be added in the future.
  • Loading branch information
sergiotejon committed Nov 12, 2024
1 parent c57bde1 commit 86aa5a9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/conventionalcommits/conventionalcommits.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,19 @@ func ReadConventionalCommits(commits []git.Commit) []CommitData {
continue
}

scope := ""
if ccData.Scope != nil {
scope = *ccData.Scope
}

cc := CommitData{
ShortHash: commit.AbbreviationHash(),
Hash: string(commit.Hash),
Date: time.Time(commit.Date),
Hash: commit.Hash,
Date: commit.Date,

CommonChangeType: commonChangeType,
ChangeType: ccData.Type,
Scope: *ccData.Scope,
Scope: scope,
Subject: ccData.Description,
}

Expand Down

0 comments on commit 86aa5a9

Please sign in to comment.