diff --git a/Dangerfile b/Dangerfile index 7b55b8bd..7cab5a1f 100644 --- a/Dangerfile +++ b/Dangerfile @@ -27,6 +27,16 @@ if has_doc_changes && !has_doc_gen_title message("Docs are generated by using [Jazzy](https://github.com/realm/jazzy). If you want to contribute, please update [markdown guides](https://github.com/Instagram/IGListKit/tree/master/Guides)") end +# Warn if Source files were added or removed but examples are not updated +added_source_files = !git.added_files.grep(/Source/).empty? +deleted_source_files = !git.deleted_files.grep(/Source/).empty? +ios_pods_not_updated = !git.modified_files.include?("Examples/Examples-iOS/Podfile.lock") +macos_pods_not_updated = !git.modified_files.include?("Examples/Examples-macOS/Podfile.lock") +tvos_pods_not_updated = !git.modified_files.include?("Examples/Examples-tvOS/Podfile.lock") +if (added_source_files || deleted_source_files) && (ios_pods_not_updated || macos_pods_not_updated || tvos_pods_not_updated) + warn("Adding or removing library source files requires updating the examples. Please run `./scripts/pod_setup.sh` from the root directory and commit the changes.") +end + swiftlint.verbose = true swiftlint.config_file = '.swiftlint_CI.yml' swiftlint.lint_files(inline_mode: true)