From 6454ff185158d2f55451f83e9ba28101eb9ed9fb Mon Sep 17 00:00:00 2001 From: Marco Cesarato Date: Thu, 29 Jul 2021 14:40:45 +0200 Subject: [PATCH] refactor: change order of configuration --- docs/config.md | 4 ++-- src/Configuration.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/config.md b/docs/config.md index 300e80e..31c5e95 100644 --- a/docs/config.md +++ b/docs/config.md @@ -27,7 +27,6 @@ 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 @@ -35,6 +34,7 @@ dir or use the `--config` option to specify the location of your configuration f 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 @@ -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}}', diff --git a/src/Configuration.php b/src/Configuration.php index 10e8c01..ef26d7a 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -138,13 +138,6 @@ class Configuration */ protected $disableLinks = false; - /** - * Allows configurable changelog version header format. - * - * @var string - */ - protected $changelogVersionFormat = '## {{version}} ({{date}})'; - /** * Hidden references. * @@ -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. * @@ -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(),