Skip to content

Commit

Permalink
Add a project spec for future changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
richardstewart0213 committed Sep 24, 2022
1 parent 64c8880 commit 756a808
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 @@ -50,7 +50,6 @@ Here are a few examples:

```
* [#716](https://github.com/rubocop/rubocop-performance/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][])
```

* Create one file `changelog/{type}_{some_description}.md`, where `type` is `new` (New feature), `fix` or `change`, and `some_description` is unique to avoid conflicts. Task `changelog:fix` (or `:new` or `:change`) can help you.
Expand Down
7 changes: 7 additions & 0 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@

include_examples 'has Changelog format'

it 'has a link to the issue or pull request address at the beginning' do
repo = 'rubocop/rubocop-performance'
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 756a808

Please sign in to comment.