Sha256: 9b4e3848e26e64b3d1baf03b3acd12d9e0250afe3a8b8ab61862a9280c28984e

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

# Make sure non-trivial amounts of code changes come with corresponding tests
has_app_changes = !git.modified_files.grep(/lib/).empty?
has_spec_changes = !git.modified_files.grep(/spec/).empty?

if git.lines_of_code > 50 && has_app_changes && !has_spec_changes
  warn('There are code changes, but no corresponding tests. '\
         'Please include tests if this PR introduces any modifications in '\
         'behavior.',
       sticky: false)
end

# Mainly to encourage writing up some reasoning about the PR, rather than
# just leaving a title
warn('Please add a detailed summary in the description.') if github.pr_body.length < 5

# Let people say that this isn't worth a CHANGELOG entry in the PR if they choose
declared_trivial = (github.pr_title + github.pr_body).include?('#trivial') || !has_app_changes

if !git.modified_files.include?('CHANGELOG.md') && !declared_trivial
  error_message = "Please include a CHANGELOG entry. \nYou can find it at " \
                  '[CHANGELOG.md](https://github.com/ualbertalib/pushmi_pullyu/blob/main/CHANGELOG.md).'
  fail(error_message, sticky: false)
end

# Warn when there is a big PR
warn('This PR is too big! Consider breaking it down into smaller PRs.') if git.lines_of_code > 500

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pushmi_pullyu-2.1.6 Dangerfile
pushmi_pullyu-2.1.5 Dangerfile
pushmi_pullyu-2.1.4 Dangerfile