Skip to content

Conversation

@artem-y
Copy link
Owner

@artem-y artem-y commented Jan 21, 2025

In this PR:

  • updated the default config behavior
  • updated unit test to reflect the new expected result
  • updated the README file to keep it up to date with this change

Details:

Previously, when config had omitted values, the command was replacing each of them with a default value.
For example, if the .commit.json file contained only the issue regex

{  
    "issueRegex": "ABC-[0-9]+" 
}

the resulting config would be as follows:

{  
    "issueRegex": "ABC-[0-9]+", 
    "outputIssuePrefix": "#",
    "outputIssueSuffix": "",
    "outputStringPrefix": "",
    "outputStringSuffix": ": ",
}

Note that outputIssuePrefix and outputStringSuffix have default values here that were not originally specified by the user, even though they provided the .commit.json config file.

While this was the default behavior I wanted at the time of initial development of the tool, after using it for a while and talking to other users, I think having these values set by default is counterintuitive. From now on, if the same content was provided in the config file, the missing properties will default to empty strings.

However, if no config file was specified, the tool will still default to the GitHub issue style with simple output formatting.

@artem-y artem-y added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 21, 2025
@artem-y artem-y self-assigned this Jan 21, 2025
@artem-y artem-y merged commit 388f41b into main Jan 21, 2025
1 check passed
@artem-y artem-y deleted the feat/update-default-config-behaviour branch February 8, 2025 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants