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
koic committed Sep 25, 2022
1 parent 6e46f9e commit 15f7954
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Expand Up @@ -50,8 +50,7 @@ $ rubocop -V
Here are a few examples:

```
* [#716](https://github.com/rubocop/rubocop-minitest/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][])
* [#172](https://github.com/rubocop/rubocop-minitest/issues/172): Fix a false positive for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` when using numbered parameters. ([@koic][])
```

* 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
9 changes: 9 additions & 0 deletions test/project_test.rb
Expand Up @@ -85,6 +85,15 @@ def test_body_ends_with_a_punctuation
end
end

def test_feature_entry_has_a_link_to_the_issue_or_pull_request_address_at_the_beginning
repo = 'rubocop/rubocop-minitest'
address_pattern = %r{\A\* \[#\d+\]\(https://github\.com/#{repo}/(issues|pull)/\d+\):}

@feature_entries.each do |path|
assert_match(address_pattern, File.read(path))
end
end

def test_feature_entry_has_a_link_to_the_contributors_at_the_end
@feature_entries.each do |path|
assert_match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/, File.read(path))
Expand Down

0 comments on commit 15f7954

Please sign in to comment.