Skip to content

Commit 67b74da

Browse files
committed
Dangerfile: warn when Url.RESOURCES_VERSION constant wasn't updated.
Addressed to #537
1 parent a88b334 commit 67b74da

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Dangerfile

+8
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,14 @@ if github.branch_for_head !~ /^gh[0-9]+_/
702702
)
703703
end
704704

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

0 commit comments

Comments
 (0)