Skip to content

Commit 9bbfae3

Browse files
koicbbatsov
authored andcommitted
Add contribution note for CHANGELOG.md
Occasionally I review direct edit to the CHANGELOG.md: - rubocop#11559 (comment) - rubocop#11406 (comment) - rubocop#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.
1 parent e66e3c7 commit 9bbfae3

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change log
22

3+
<!---
4+
Do NOT edit this CHANGELOG.md file by hand directly, as it is automatically updated.
5+
6+
Please add an entry file to the https://github.com/rubocop/rubocop/blob/master/changelog/
7+
named `{change_type}_{change_description}.md` if the new code introduces user-observable changes.
8+
9+
See https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format for details.
10+
-->
11+
312
## master (unreleased)
413

514
## 1.45.1 (2023-02-08)

changelog/.gitkeep

Whitespace-only changes.

spec/project_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ def expected
156156
expect(changelog.end_with?("\n")).to be true
157157
end
158158

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

163163
describe 'entry' do

spec/tasks/changelog_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
described_class.new(content: <<~CHANGELOG, entries: list)
99
# Change log
1010
11+
<!---
12+
Do NOT edit this CHANGELOG.md file by hand directly, as it is automatically updated.
13+
14+
Please add an entry file to the https://github.com/rubocop/rubocop/blob/master/changelog/
15+
named `{change_type}_{change_description}.md` if the new code introduces user-observable changes.
16+
17+
See https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format for details.
18+
-->
19+
1120
## master (unreleased)
1221
1322
### New features

tasks/changelog.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def initialize(type:, body: last_commit_title, ref_type: nil, ref_id: nil, user:
2525
end
2626

2727
def write
28-
FileUtils.mkdir_p(ENTRIES_PATH)
2928
File.write(path, content)
3029
path
3130
end

0 commit comments

Comments
 (0)