Skip to content

Commit

Permalink
Add a project spec for future changelog entry
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koic authored and bbatsov committed Sep 12, 2022
1 parent 4b03060 commit 2d8d93f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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][])
```

Expand Down
7 changes: 7 additions & 0 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d8d93f

Please sign in to comment.