From 3d9904950a975c1d0677f7d21aac0df6937a5f93 Mon Sep 17 00:00:00 2001 From: Mukesh Thawani Date: Mon, 22 Jan 2018 14:48:08 -0800 Subject: [PATCH] Run pod_setup.sh when Source files are added or removed Summary: Issue fixed: #1022 - [ ] All tests pass. Demo project builds and runs. - [ ] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/1031 Reviewed By: jeremycohen Differential Revision: D6657283 Pulled By: rnystrom fbshipit-source-id: 3033e08dbe1a0fd5b52f254dbefc924693b84b51 --- Dangerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)