diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..a3c2db4 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,14 @@ +# Check to see if any changes were made to Spruce library +has_library_changes = !git.modified_files.grep(/Sources/).empty? + +# warn if this PR is above 200 lines +warn("Big PR") if git.lines_of_code > 200 + +# check to see if the changelog has been updated +no_changelog_entry = !git.modified_files.include?("Changelog.md") +if has_app_changes && no_changelog_entry + fail("Any changes to the Spruce library need to be documented in the Changelog") +end + +# Run SwiftLint +swiftlint.lint_files diff --git a/Gemfile b/Gemfile index c6ba4bb..ff7748c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,4 @@ gem 'fastlane' gem 'cocoapods' gem 'slather' gem 'coveralls', require: false +gem 'danger' diff --git a/Gemfile.lock b/Gemfile.lock index 050a52d..0b4e808 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,10 @@ GEM public_suffix (~> 2.0, >= 2.0.2) babosa (1.0.2) claide (1.0.1) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) clamp (0.6.5) cocoapods (1.2.0) activesupport (>= 4.0.2, < 5) @@ -47,14 +51,28 @@ GEM netrc (= 0.7.8) cocoapods-try (1.1.0) colored (1.2) + colored2 (3.1.2) commander (4.4.3) highline (~> 1.7.2) + cork (0.2.0) + colored (~> 1.2) coveralls (0.8.19) json (>= 1.8, < 3) simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) tins (~> 1.6) + danger (4.3.0) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (~> 0.9) + faraday-http-cache (~> 1.0) + git (~> 1) + kramdown (~> 1.5) + octokit (~> 4.2) + terminal-table (~> 1) docile (1.1.5) domain_name (0.5.20161129) unf (>= 0.0.5, < 1.0.0) @@ -66,6 +84,8 @@ GEM faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) + faraday-http-cache (1.3.1) + faraday (~> 0.8) faraday_middleware (0.11.0.1) faraday (>= 0.7.4, < 1.0) fastimage (2.0.1) @@ -104,6 +124,7 @@ GEM fourflusher (2.0.1) fuzzy_match (2.0.4) gh_inspector (1.0.3) + git (1.3.0) google-api-client (0.9.28) addressable (~> 2.3) googleauth (~> 0.5) @@ -129,6 +150,7 @@ GEM i18n (0.8.0) json (1.8.3) jwt (1.5.6) + kramdown (1.13.2) little-plugger (1.1.4) logging (2.1.0) little-plugger (~> 1.1) @@ -149,6 +171,9 @@ GEM netrc (0.7.8) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + octokit (4.6.2) + sawyer (~> 0.8.0, >= 0.5.3) + open4 (1.3.4) os (0.9.6) plist (3.2.0) public_suffix (2.0.5) @@ -158,6 +183,9 @@ GEM rouge (1.11.1) ruby-macho (0.2.6) rubyzip (1.2.1) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) security (0.1.3) signet (0.7.3) addressable (~> 2.3) @@ -208,6 +236,7 @@ PLATFORMS DEPENDENCIES cocoapods coveralls + danger fastlane slather diff --git a/circle.yml b/circle.yml index d37c190..b3407d1 100644 --- a/circle.yml +++ b/circle.yml @@ -7,6 +7,7 @@ general: test: override: - gem install bundler + - bundle exec danger - bundle exec fastlane run_tests post: - bundle exec slather