Skip to content

Commit

Permalink
[danger] add more checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed Feb 21, 2017
1 parent 7e30e6d commit bf3102c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
# 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
fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1
fail("fit left in tests") if `grep -r fit specs/ `.length > 1
has_app_changes = git.modified_files.grep(%{apicast/})
markdown_files = git.modified_files.grep(/\.md$/)

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/3scale/apicast/blob/master/CHANGELOG.md).")
message "Note, we hard-wrap at 80 chars and use 2 spaces after the last line."
end

ENV['LANG'] = 'en_US.utf8'
prose.lint_files markdown_files - %w(CHANGELOG.md)

# Look for spelling issues
prose.ignored_words = %w(s2i openresty APIcast nameservers resty-resolver nginx Redis OAuth ENV backend)
prose.check_spelling markdown_files - %w(CHANGELOG.md)

0 comments on commit bf3102c

Please sign in to comment.