Skip to content

Commit

Permalink
Add contribution note for CHANGELOG.md
Browse files Browse the repository at this point in the history
Occasionally I review direct edit to the CHANGELOG.md:

- #11559 (comment)
- #11406 (comment)
- #11395 (comment)

It might be communicated a little more efficiently if listed in the CHANGELOG.md.
And the triple dash for commenting out is used intentionally.
https://stackoverflow.com/questions/4823468/comments-in-markdown/4829998#4829998

It affects when markdown is viewed on GitHub. This is unnecessary note for
user viewing the CHANGELOG.md on GitHub.

Also add changelog/.gitkeep to prevent dead link after release.
  • Loading branch information
koic authored and bbatsov committed Feb 11, 2023
1 parent e66e3c7 commit 9bbfae3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change log

<!---
Do NOT edit this CHANGELOG.md file by hand directly, as it is automatically updated.

Please add an entry file to the https://github.com/rubocop/rubocop/blob/master/changelog/
named `{change_type}_{change_description}.md` if the new code introduces user-observable changes.

See https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format for details.
-->

## master (unreleased)

## 1.45.1 (2023-02-08)
Expand Down
Empty file added changelog/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def expected
expect(changelog.end_with?("\n")).to be true
end

it 'has either entries, headers, or empty lines' do
expect(non_reference_lines).to all(match(/^(\*|#|$)/))
it 'has either entries, headers, empty lines, or comments' do
expect(non_reference_lines).to all(match(/^(\*|#|$|<!---|-->| )/))
end

describe 'entry' do
Expand Down
9 changes: 9 additions & 0 deletions spec/tasks/changelog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
described_class.new(content: <<~CHANGELOG, entries: list)
# Change log
<!---
Do NOT edit this CHANGELOG.md file by hand directly, as it is automatically updated.
Please add an entry file to the https://github.com/rubocop/rubocop/blob/master/changelog/
named `{change_type}_{change_description}.md` if the new code introduces user-observable changes.
See https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format for details.
-->
## master (unreleased)
### New features
Expand Down
1 change: 0 additions & 1 deletion tasks/changelog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def initialize(type:, body: last_commit_title, ref_type: nil, ref_id: nil, user:
end

def write
FileUtils.mkdir_p(ENTRIES_PATH)
File.write(path, content)
path
end
Expand Down

0 comments on commit 9bbfae3

Please sign in to comment.