Skip to content

Commit

Permalink
Merge pull request #4841 from duckinator/issue-4808
Browse files Browse the repository at this point in the history
Only check if descriptions *start with* FIXME/TODO
  • Loading branch information
deivid-rodriguez committed Sep 21, 2021
2 parents 3387dbf + 7890c98 commit 8721fe2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubygems/specification_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def validate_licenses
end

LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, '')
LAZY_PATTERN = /FI XME|TO DO/x.freeze
LAZY_PATTERN = /^FI XME|^TO DO/x.freeze
HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze

def validate_lazy_metadata
Expand Down
14 changes: 14 additions & 0 deletions test/rubygems/test_gem_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2781,6 +2781,20 @@ def test_validate_description
end

assert_equal %("#{f}" or "#{t}" is not a description), e.message

# Adding #{f} anywhere after the start of the description should be fine.
@a1.description = "(some description) #{f}"

assert_nothing_raised do
@a1.validate
end

# Adding #{t} anywhere after the start of the description should be fine.
@a1.description = "(some description) #{t}"

assert_nothing_raised do
@a1.validate
end
end
end

Expand Down

0 comments on commit 8721fe2

Please sign in to comment.