Skip to content

Commit

Permalink
[ci skip] danger
Browse files Browse the repository at this point in the history
  • Loading branch information
nbulaj committed Oct 4, 2018
1 parent a67568d commit d5144b7
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 4 deletions.
29 changes: 26 additions & 3 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Danger::Changelog.configure do |config|
config.filename = 'NEWS.md'
CHANGELOG_FILE = 'NEWS.md'
GITHUB_REPO = 'https://github.com/doorkeeper-gem/doorkeeper'

def changelog_changed?
git.modified_files.include?(CHANGELOG_FILE) || git.added_files.include?(CHANGELOG_FILE)
end

def changelog_entry_example
pr_number = github.pr_json['number']
pr_url = github.pr_json['html_url']
pr_title = github.pr_title
.sub(/[?.!,;]?$/, '')
.capitalize

"- [##{pr_number}](#{pr_url}): #{pr_title}."
end

# --------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -31,4 +44,14 @@ end
# --------------------------------------------------------------------------------------------------------------------
# Have you updated CHANGELOG.md?
# --------------------------------------------------------------------------------------------------------------------
changelog.check
# Add a CHANGELOG entry for app changes
if has_app_changes && !changelog_changed?
markdown <<-MARKDOWN
Here's an example of a #{CHANGELOG_FILE} entry:
```markdown
#{changelog_entry_example}
```
MARKDOWN

fail("Please include a changelog entry. \nYou can find it at [#{CHANGELOG_FILE}](#{GITHUB_REPO}/blob/master/#{CHANGELOG_FILE}).")
end
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class ApplicationController <
Doorkeeper.configuration.base_controller.constantize
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/application_metal_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class ApplicationMetalController < ActionController::Metal
MODULES = [
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/applications_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class ApplicationsController < Doorkeeper::ApplicationController
layout 'doorkeeper/admin' unless Doorkeeper.configuration.api_only
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/authorizations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class AuthorizationsController < Doorkeeper::ApplicationController
before_action :authenticate_resource_owner!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class AuthorizedApplicationsController < Doorkeeper::ApplicationController
before_action :authenticate_resource_owner!
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/token_info_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class TokenInfoController < Doorkeeper::ApplicationMetalController
def show
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/doorkeeper/tokens_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class TokensController < Doorkeeper::ApplicationMetalController
def create
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/doorkeeper/dashboard_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
module DashboardHelper
def doorkeeper_errors_for(object, method)
Expand Down
2 changes: 2 additions & 0 deletions app/validators/redirect_uri_validator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'uri'

class RedirectUriValidator < ActiveModel::EachValidator
Expand Down
1 change: 0 additions & 1 deletion doorkeeper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'capybara', '~> 2.18'
gem.add_development_dependency 'coveralls'
gem.add_development_dependency 'danger', '~> 5.0'
gem.add_development_dependency 'danger-changelog', '~> 0.3'
gem.add_development_dependency 'grape'
gem.add_development_dependency 'database_cleaner', '~> 1.6'
gem.add_development_dependency 'factory_bot', '~> 4.8'
Expand Down
2 changes: 2 additions & 0 deletions lib/doorkeeper/engine.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Doorkeeper
class Engine < Rails::Engine
initializer "doorkeeper.params.filter" do |app|
Expand Down

0 comments on commit d5144b7

Please sign in to comment.