Skip to content

Commit e4e0e99

Browse files
committed
Dangerfile: warn when Url.RESOURCES_VERSION constant wasn't updated.
1 parent d799a15 commit e4e0e99

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Dangerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,14 @@ if github.branch_for_head !~ /^gh[0-9]+_/
701701
)
702702
end
703703

704+
js_file = %r{^src/main/javascript/.*\.js$}
705+
css_file = %r{^src/main/webapp/.*\.css$}
706+
modified_resources = git.modified_files.any? { |file| file =~ js_file || file =~ css_file }
707+
updated_url = git.modified_files.include? 'src/main/java/ru/mystamps/web/Url.java'
708+
if modified_resources && !updated_url
709+
warn("danger check: looks like you forgot to update `Url.RESOURCES_VERSION` after modifying JS/CSS file(s)")
710+
end
711+
704712
all_checks_passed = violation_report[:errors].empty? && violation_report[:warnings].empty? && violation_report[:messages].empty?
705713
if all_checks_passed
706714
message(

0 commit comments

Comments
 (0)