RuboCop: Style/DefWithParentheses

[skip-stages=Flakey]

auto-corrected

Change-Id: I307ab0202a37b018073d7663342ee63f229cd42d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278353
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2021-11-15 15:32:56 -07:00
parent 14ee01c805
commit f946fffbac
12 changed files with 13 additions and 11 deletions

View File

@ -170,6 +170,8 @@ Style/ColonMethodCall:
Severity: error
Style/ConditionalAssignment:
Severity: error
Style/DefWithParentheses:
Severity: error
Style/Documentation:
Enabled: false # most things don't need to be documented
Style/EmptyCaseCondition:

View File

@ -761,7 +761,7 @@ class DiscussionTopicsApiController < ApplicationController
render_state_change_result @topic.change_read_state(new_state, @current_user)
end
def get_forced_option()
def get_forced_option
opts = {}
opts[:forced] = value_to_boolean(params[:forced_read_state]) if params.key?(:forced_read_state)
opts

View File

@ -29,7 +29,7 @@ module Lti
@context_external_tool = context_external_tool
end
def convert()
def convert
LtiOutbound::LTITool.new.tap do |lti_tool|
lti_tool.name = @context_external_tool.name
lti_tool.consumer_key = @context_external_tool.consumer_key

View File

@ -97,7 +97,7 @@ module Lti
.filter_map { |e| e.try(:associated_user).try(:lti_context_id) }
end
def current_account_enrollments()
def current_account_enrollments
@current_account_enrollments ||= if @canvas_context.respond_to?(:account_chain) && !@canvas_context.account_chain.empty?
@canvas_user.account_users.active.where(account_id: @canvas_context.account_chain).distinct.to_a
else

View File

@ -323,7 +323,7 @@ module AttachmentFu # :nodoc:
end
# nil placeholder in case this field is used in a form.
def uploaded_data()
def uploaded_data
nil
end

View File

@ -30,7 +30,7 @@ describe "CanvasHttp" do
fake_logger = Class.new do
attr_reader :messages
def initialize()
def initialize
@messages = []
super
end

View File

@ -100,7 +100,7 @@ module IncomingMailProcessor
# Returns the return value of the block.
# Raises Timeout::Error if the block takes longer than the default timeout
# duration.
def default_timeout_method()
def default_timeout_method
Timeout.timeout(default_timeout_duration) do
yield
end

View File

@ -24,7 +24,7 @@ module LtiOutbound
attr_reader :substitution_objects
def initialize()
def initialize
self.substitutions = {}
end

View File

@ -121,7 +121,7 @@ module AccountReports
end
end
def unused_courses()
def unused_courses
courses = root_account.all_courses.active
.select("courses.id, courses.name, courses.course_code,
courses.sis_source_id, courses.created_at,

View File

@ -24,7 +24,7 @@ describe "Gradebook - group weights" do
include_context "in-process server selenium tests"
include GradebookCommon
def student_totals()
def student_totals
totals = ff('.total-cell')
points = []
for i in totals do

View File

@ -51,7 +51,7 @@ module WeightingSetup
@a4.grade_student(@student, grade: 16, grader: @teacher)
end
def create_weighted_grading_periods()
def create_weighted_grading_periods
# :sigh: ... in the case of SRGB, the grading period dropdown behavior
# is "interesting"... specifically 1. only the first change event
# records your preference, 2. if its value doesn't change, no

View File

@ -224,7 +224,7 @@ describe 'RCE Next autosave feature', ignore_js_errors: true do
stub_rcs_config
end
def account_with_admin_logged_in()
def account_with_admin_logged_in
@account = Account.default
account_admin_user
user_session(@admin)