mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-19 07:18:26 +00:00
Summary: Getting some basic Danger automation up and running. Should see comments from iglistkit-bot. Issue fixed: #394 Closes https://github.com/Instagram/IGListKit/pull/541 Differential Revision: D4698292 Pulled By: rnystrom fbshipit-source-id: 32520c053bd624504b76bc0cef4cfb7ea9313a7d
20 lines
813 B
Ruby
20 lines
813 B
Ruby
not_declared_trivial = !(github.pr_title.include? "#trivial")
|
|
has_source_changes = !git.modified_files.grep(/Source/).empty?
|
|
|
|
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
|
|
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
|
|
|
|
# Changelog entries are required for changes to library files.
|
|
no_changelog_entry = !git.modified_files.include?("CHANGELOG.md")
|
|
if has_source_changes && no_changelog_entry && not_declared_trivial
|
|
fail("Any source code changes should have an entry in CHANGELOG.md.")
|
|
end
|
|
|
|
# Docs are regenerated when releasing
|
|
has_doc_changes = !git.modified_files.grep(/docs/).empty?
|
|
if has_doc_changes
|
|
warn("Docs are regenerated when creating new releases.")
|
|
end
|