Skip to content

Commit

Permalink
Upgraded danger, danger-changelog and added danger-toc.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed May 9, 2020
1 parent 4456d2c commit c2fe39b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
11 changes: 6 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-07-30 11:43:22 -0400 using RuboCop version 0.42.0.
# on 2020-05-09 10:55:58 -0400 using RuboCop version 0.82.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 18
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 195
Layout/LineLength:
Max: 169
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ language: ruby
sudo: false

rvm:
- 2.3.1
- 2.3.0
- 2.2
- 2.1
- ruby-head
- jruby-9.0.5.0
- rbx-2

allow_failures:
- ruby-head
- rbx-2
- 2.6.6

before_script:
- bundle exec danger
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### Changelog

### 0.1.2 (Next)
### 0.2.0 (Next)

* [#8](https://github.com/ruby-grape/danger/pull/8): Upgraded Danger 8.0, danger-changelog 0.6.1 and added danger-toc 0.2.0 - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.1.1 (12/5/2016)
Expand Down
16 changes: 11 additions & 5 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# --------------------------------------------------------------------------------------------------------------------
# Has any changes happened inside the actual library code?
# --------------------------------------------------------------------------------------------------------------------
Expand All @@ -7,9 +9,7 @@ has_spec_changes = !git.modified_files.grep(/spec/).empty?
# --------------------------------------------------------------------------------------------------------------------
# You've made changes to lib, but didn't write any tests?
# --------------------------------------------------------------------------------------------------------------------
if has_app_changes && !has_spec_changes
warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false)
end
warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false) if has_app_changes && !has_spec_changes

# --------------------------------------------------------------------------------------------------------------------
# You've made changes to specs, but no library code has changed?
Expand All @@ -21,15 +21,21 @@ end
# --------------------------------------------------------------------------------------------------------------------
# Have you updated CHANGELOG.md?
# --------------------------------------------------------------------------------------------------------------------
changelog.check
changelog.check!

# --------------------------------------------------------------------------------------------------------------------
# Do you have a TOC?
# --------------------------------------------------------------------------------------------------------------------
toc.check!

# --------------------------------------------------------------------------------------------------------------------
# Don't let testing shortcuts get into master by accident,
# ensuring that we don't get green builds based on a subset of tests.
# --------------------------------------------------------------------------------------------------------------------

(git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
(git.modified_files + git.added_files - %w[Dangerfile]).each do |file|
next unless File.file?(file)

contents = File.read(file)
if file.start_with?('spec')
fail("`xit` or `fit` left in tests (#{file})") if contents =~ /^\w*[xf]it/
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source 'https://rubygems.org'

gemspec

gem 'rubocop', '0.42.0'
gem 'rubocop', '0.82.0'
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rubygems'
require 'bundler'

Expand All @@ -11,4 +13,4 @@ RuboCop::RakeTask.new
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task default: [:rubocop, :spec]
task default: %i[rubocop spec]
5 changes: 3 additions & 2 deletions ruby-grape-danger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gem::Specification.new do |s|

s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
s.add_runtime_dependency 'danger', '~> 4.0.1'
s.add_runtime_dependency 'danger-changelog', '~> 0.2.0'
s.add_runtime_dependency 'danger', '~> 8.0.0'
s.add_runtime_dependency 'danger-changelog', '~> 0.6.1'
s.add_runtime_dependency 'danger-toc', '~> 0.2.0'
end

0 comments on commit c2fe39b

Please sign in to comment.