summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-30 17:46:22 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-30 17:46:22 +0000
commit1a59b350d84b661af3ebf41ca4c034f29157d92b (patch)
tree0e21f3a3ac611f4807cc41d9a0b4499398dc92a9
parenta8e80d4a59a4e071c61a2789611aaf7a300bf8f8 (diff)
parent9d5f80e00b08fa75469fc8be1bb151308580de9a (diff)
downloadgitlab-ce-1a59b350d84b661af3ebf41ca4c034f29157d92b.tar.gz
Merge branch 'style/enable-method-def-parentheses-rubocop-cop' into 'master'
Enable Style/MethodDefParentheses rubocop cop Use def with parentheses when there are parameters. See #17478 See merge request !4352
-rw-r--r--.rubocop.yml2
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb2
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/project.rb4
4 files changed, 5 insertions, 5 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index f547852763b..e884cfd8ed3 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -330,7 +330,7 @@ Style/MethodCallParentheses:
# Checks if the method definitions have or don't have parentheses.
Style/MethodDefParentheses:
- Enabled: false
+ Enabled: true
# Use the configured style when naming methods.
Style/MethodName:
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index df98f56a1cd..f35d631df0c 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -97,7 +97,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
handle_signup_error
end
- def handle_service_ticket provider, ticket
+ def handle_service_ticket(provider, ticket)
Gitlab::OAuth::Session.create provider, ticket
session[:service_tickets] ||= {}
session[:service_tickets][provider] = ticket
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index ff7dd44c526..5e77fda70b9 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -286,7 +286,7 @@ module Ci
project.runners_token
end
- def valid_token? token
+ def valid_token?(token)
project.valid_runners_token? token
end
diff --git a/app/models/project.rb b/app/models/project.rb
index f3a56b86d5a..c1d9bae44c9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -946,13 +946,13 @@ class Project < ActiveRecord::Base
shared_runners_enabled? && Ci::Runner.shared.active.any?(&block)
end
- def valid_runners_token? token
+ def valid_runners_token?(token)
self.runners_token && ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.runners_token)
end
# TODO (ayufan): For now we use runners_token (backward compatibility)
# In 8.4 every build will have its own individual token valid for time of build
- def valid_build_token? token
+ def valid_build_token?(token)
self.builds_enabled? && self.runners_token && ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.runners_token)
end