Skip to content

Commit

Permalink
refactor: change order of configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Cesarato committed Jul 29, 2021
1 parent fff0747 commit 6454ff1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ dir or use the `--config` option to specify the location of your configuration f
- **Skip Tag:** Skip automatic commit tagging
- **Skip Verify:** Skip the pre-commit and commit-msg hooks
- **Disable Links:** Render text instead of link in changelog
- **Changelog Version Format:** Allows the version header in changelog to have a configurable format
- **Hidden Hash:** Hide commit hash from changelog
- **Hidden Mentions:** Hide users mentions from changelog
- **Hidden References:** Hide issue references from changelog
- **Pretty Scope:** Prettify the scope commit part (section name) on changelog *(ex. UserManager => User Manager or
user_config => User config)*
- **Url Protocol:** The URL protocol of all repository urls on changelogs (http/https)
- **Date Format:** The [format](https://www.php.net/manual/en/datetime.format.php) of the outputted date string
- **Changelog Version Format:** Allows the version header in changelog to have a configurable format
- **Commit Url Format:** A URL representing a specific commit at a hash
- **Compare Url Format:** A URL representing the comparison between two git sha
- **Issue Url Format:** A URL representing the issue format (allowing a different URL format to be swapped in for
Expand Down Expand Up @@ -85,13 +85,13 @@ return [
'skipTag' => false,
'skipVerify' => false,
'disableLinks' => false,
'changelogVersionFormat' => '## {{version}} ({{date}})',
'hiddenHash' => false,
'hiddenMentions' => false,
'hiddenReferences' => false,
'prettyScope' => true,
'urlProtocol' => 'https',
'dateFormat' => 'Y-m-d',
'changelogVersionFormat' => '## {{version}} ({{date}})',
'commitUrlFormat' => '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}',
'compareUrlFormat' => '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}',
'issueUrlFormat' => '{{host}}/{{owner}}/{{repository}}/issues/{{id}}',
Expand Down
16 changes: 8 additions & 8 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ class Configuration
*/
protected $disableLinks = false;

/**
* Allows configurable changelog version header format.
*
* @var string
*/
protected $changelogVersionFormat = '## {{version}} ({{date}})';

/**
* Hidden references.
*
Expand Down Expand Up @@ -187,6 +180,13 @@ class Configuration
*/
protected $dateFormat = 'Y-m-d';

/**
* Allows configurable changelog version header format.
*
* @var string
*/
protected $changelogVersionFormat = '## {{version}} ({{date}})';

/**
* A URL representing a specific commit at a hash.
*
Expand Down Expand Up @@ -301,13 +301,13 @@ public function fromArray(array $array)
'skipTag' => $this->skipTag(),
'skipVerify' => $this->skipVerify(),
'disableLinks' => $this->isDisableLinks(),
'changelogVersionFormat' => $this->getChangelogVersionFormat(),
'hiddenHash' => $this->isHiddenHash(),
'hiddenMentions' => $this->isHiddenMentions(),
'hiddenReferences' => $this->isHiddenReferences(),
'prettyScope' => $this->isPrettyScope(),
'urlProtocol' => $this->getUrlProtocol(),
'dateFormat' => $this->getDateFormat(),
'changelogVersionFormat' => $this->getChangelogVersionFormat(),
'commitUrlFormat' => $this->getCommitUrlFormat(),
'compareUrlFormat' => $this->getCompareUrlFormat(),
'issueUrlFormat' => $this->getIssueUrlFormat(),
Expand Down

0 comments on commit 6454ff1

Please sign in to comment.