Sha256: 3cedca07c22589e0106862f92359a8cdb28169f2279d8d4d383bbd78e879ba99

Contents?: true

Size: 1.16 KB

Versions: 18

Compression:

Stored size: 1.16 KB

Contents

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# Don't let testing shortcuts get into master by accident
(git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
  next unless File.file?(file)
  contents = File.read(file)
  if file.start_with?('spec')
    fail("`xit` or `fit` left in tests (#{file})") if contents =~ /^\w*[xf]it/
    fail("`fdescribe` left in tests (#{file})") if contents =~ /^\w*fdescribe/
  end
end

# Sometimes its a README fix, or something like that - which isn't relevant for
# including in a CHANGELOG for example
has_app_changes = !git.modified_files.grep(/lib/).empty?
has_test_changes = !git.modified_files.grep(/spec/).empty?

# Add a CHANGELOG entry for app changes
if !git.modified_files.include?("CHANGELOG.md") && has_app_changes
  fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/realm/jazzy/blob/master/CHANGELOG.md).")
  message "Note, we hard-wrap at 80 chars and use 2 spaces after the last line."
end

# Non-trivial amounts of app changes without tests
if git.lines_of_code > 50 && has_app_changes && !has_test_changes
    warn "This PR may need tests."
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
jazzy-0.13.7 Dangerfile
jazzy-0.13.6 Dangerfile
jazzy-0.13.5 Dangerfile
jazzy-0.13.4 Dangerfile
jazzy-0.13.3 Dangerfile
jazzy-0.13.2 Dangerfile
jazzy-0.13.1 Dangerfile
jazzy-0.13.0 Dangerfile
jazzy-0.12.0 Dangerfile
jazzy-0.11.2 Dangerfile
jazzy-0.11.1 Dangerfile
jazzy-0.11.0 Dangerfile
jazzy-0.10.0 Dangerfile
jazzy-0.9.6 Dangerfile
jazzy-0.9.5 Dangerfile
jazzy-0.9.4 Dangerfile
jazzy-0.9.3 Dangerfile
jazzy-0.9.2 Dangerfile