2018-05-21 12:41:21 -04:00
|
|
|
# rubocop:disable Style/SignalException
|
|
|
|
|
2018-07-10 06:10:54 -04:00
|
|
|
NO_NEW_SPEC_MESSAGE = <<~MSG
|
|
|
|
You've made some app changes, but didn't add any tests.
|
|
|
|
That's OK as long as you're refactoring existing code,
|
|
|
|
but please consider adding the ~backstage label in that case.
|
|
|
|
MSG
|
|
|
|
|
2018-05-21 12:41:21 -04:00
|
|
|
has_app_changes = !git.modified_files.grep(%r{\A(ee/)?(app|lib|db/(geo/)?(post_)?migrate)/}).empty?
|
|
|
|
has_spec_changes = !git.modified_files.grep(/spec/).empty?
|
|
|
|
|
|
|
|
if has_app_changes && !has_spec_changes
|
2018-07-10 06:10:54 -04:00
|
|
|
warn NO_NEW_SPEC_MESSAGE, sticky: false
|
2018-05-21 12:41:21 -04:00
|
|
|
end
|