From 2d8d93f8689801b49978181ae235161093557785 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 5 Sep 2022 10:11:03 +0900 Subject: [PATCH] Add a project spec for future changelog entry CHANGELOG.md is already mixed with and without URLs, so direct editing of CHANGELOG.md was hard to prevent formatting without URL, but the new form of adding future changelog entry to the changelog directory can force URL. Instead of reviewer pointing out, the automated test failure can inform that to reviewee. --- CONTRIBUTING.md | 1 - spec/project_spec.rb | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9bdbdadd8bc3..7116b36e0b11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,7 +93,6 @@ Here are a few examples: ```markdown * [#716](https://github.com/rubocop/rubocop/issues/716): Fixed a regression in the autocorrection logic of `MethodDefParentheses`. ([@bbatsov][]) -* New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][]) * [#7542](https://github.com/rubocop/rubocop/pull/7542): **(Breaking)** Move `LineLength` cop from `Metrics` department to `Layout` department. ([@koic][]) ``` diff --git a/spec/project_spec.rb b/spec/project_spec.rb index 08a47e52c446..e01c4f16168b 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -242,6 +242,13 @@ def expected include_examples 'has Changelog format' + it 'has a link to the issue or pull request address at the beginning' do + repo = 'rubocop/rubocop' + address_pattern = %r{\A\* \[#\d+\]\(https://github\.com/#{repo}/(issues|pull)/\d+\):} + + expect(entries).to all(match(address_pattern)) + end + it 'has a link to the contributors at the end' do expect(entries).to all(match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/)) end