File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def validate_authors
39
39
return if no_changes?
40
40
41
41
authors =
42
- lines . reverse . find { |line | line . match? ( /\* [^\d \s ]+( \s [^ \d \s ]+)* \* / ) }
42
+ lines . reverse . find { |line | line . match? ( /^ * \* [^* \s ].*[^* \s ] \* $ / ) }
43
43
44
44
return if authors
45
45
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ def test_entries_without_author_are_invalid
18
18
assert_equal 2 , offenses . length
19
19
end
20
20
21
+ def test_valid_username_is_valid_author
22
+ assert_valid_entry <<~CHANGELOG
23
+ * Cool change.
24
+
25
+ *1337-rails-c0d3r*
26
+ CHANGELOG
27
+ end
28
+
21
29
def test_parses_with_extra_newlines
22
30
@changelog = changelog_fixture ( "action_mailbox_83d85b2.md" )
23
31
@@ -126,6 +134,11 @@ def offenses
126
134
entries . flat_map ( &:offenses )
127
135
end
128
136
137
+ def assert_valid_entry ( source )
138
+ entry = RailInspector ::Changelog ::Entry . new ( source . lines ( chomp : true ) , 1 )
139
+ assert_empty entry . offenses , "Entry has offenses"
140
+ end
141
+
129
142
ANNOTATION_PATTERN = /\s *\^ + /
130
143
131
144
def assert_offense ( source )
You can’t perform that action at this time.
0 commit comments