Skip to content

Commit

Permalink
Tweak changelog format doc and add a project spec
Browse files Browse the repository at this point in the history
The changelog entry file format doesn't require a link to
GitHub account URL (`[@username]: https://github.com/username`),
so contributors can write it in one line.
This PR tweaks CONTRIBUTING.md and adds a project spec for that.

It will prevent the following breaking changelog generation.
f598124
  • Loading branch information
koic authored and bbatsov committed Nov 12, 2021
1 parent 6419a29 commit da654a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -93,12 +93,12 @@ Here are a few examples:

* 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.
* Mark it up in [Markdown syntax][6].
* The entry line should start with `* ` (an asterisk and a space).
* The entry should be a single line, starting with `* ` (an asterisk and a space).
* If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/rubocop/rubocop/issues/123): `.
* Describe the brief of the change. The sentence should end with a punctuation.
* If this is a breaking change, mark it with `**(Breaking)**`.
* At the end of the entry, add an implicit link to your GitHub user page as `([@username][])`.
* Alternatively, you may modify the CHANGELOG file directly, but this may result in conflicts later on. Also, if this is your first contribution to RuboCop project, add a link definition for the implicit link to the bottom of the changelog as `[@username]: https://github.com/username`.
* Alternatively, you may modify the CHANGELOG.md file directly, but this may result in conflicts later on. Also, if this is your first contribution to RuboCop project, add a link definition for the implicit link to the bottom of the changelog as `[@username]: https://github.com/username`.

[1]: https://github.com/rubocop/rubocop/issues
[2]: https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request
Expand Down
4 changes: 4 additions & 0 deletions spec/project_spec.rb
Expand Up @@ -242,6 +242,10 @@ def expected
expect(entries).to all(match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/))
end

it 'has a single line' do
expect(File.foreach(path).count).to eq(1)
end

it 'starts with `new_`, `fix_`, or `change_`' do
expect(File.basename(path)).to(match(/\A(new|fix|change)_.+/))
end
Expand Down

0 comments on commit da654a7

Please sign in to comment.