Skip to content

Commit 4bd5d20

Browse files
committed
Don't add CHANGELOG offenses to "no changes" line
1 parent e5386cb commit 4bd5d20

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

tools/rail_inspector/lib/rail_inspector/changelog.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def header
3636
end
3737

3838
def validate_authors
39+
return if no_changes?
40+
3941
authors =
4042
lines.reverse.find { |line| line.match?(/\*[^\d\s]+(\s[^\d\s]+)*\*/) }
4143

@@ -87,6 +89,10 @@ def validate_trailing_whitespace
8789
end
8890

8991
private
92+
def no_changes?
93+
lines.first == "* No changes."
94+
end
95+
9096
def add_offense(...)
9197
@offenses << Offense.new(...)
9298
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Rails 7.1.0.rc1 (September 13, 2023) ##
2+
3+
* No changes.
4+
5+
6+
## Rails 7.1.0.beta1 (September 13, 2023) ##
7+
8+
* Fix `simple_format` with blank `wrapper_tag` option returns plain html tag
9+
10+
By default `simple_format` method returns the text wrapped with `<p>`. But if we explicitly specify
11+
the `wrapper_tag: nil` in the options, it returns the text wrapped with `<></>` tag.
12+
13+
Before:
14+
15+
```ruby
16+
simple_format("Hello World", {}, { wrapper_tag: nil })
17+
# <>Hello World</>
18+
```
19+
20+
After:
21+
22+
```ruby
23+
simple_format("Hello World", {}, { wrapper_tag: nil })
24+
# <p>Hello World</p>
25+
```
26+
27+
*Akhil G Krishnan*, *Junichi Ito*
28+
29+
* Don't double-encode nested `field_id` and `field_name` index values
30+
31+
Pass `index: @options` as a default keyword argument to `field_id` and
32+
`field_name` view helper methods.
33+
34+
*Sean Doyle*
35+
36+
* Allow opting in/out of `Link preload` headers when calling `stylesheet_link_tag` or `javascript_include_tag`
37+
38+
```ruby
39+
# will exclude header, even if setting is enabled:
40+
javascript_include_tag("http://example.com/all.js", preload_links_header: false)
41+
42+
# will include header, even if setting is disabled:
43+
stylesheet_link_tag("http://example.com/all.js", preload_links_header: true)
44+
```
45+
46+
*Alex Ghiculescu*

tools/rail_inspector/test/rail_inspector/changelog_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def test_release_header_is_not_treated_as_offense
5454
assert_equal 0, offenses.length
5555
end
5656

57+
def test_no_changes_not_treated_as_offense
58+
@changelog = changelog_fixture("action_mailbox.md")
59+
60+
assert_equal 0, offenses.length
61+
end
62+
5763
def test_validate_authors
5864
assert_offense(<<~CHANGELOG)
5965
* Fix issue in CHANGELOG linting

0 commit comments

Comments
 (0)