RuboCop: Style/EmptyMethod

[skip-stages=Flakey]

auto-corrected, with post review to remove unnecessary empty down methods
in migrations, and change def x(*args); end to just def x(*); end

Change-Id: Ic006bcebb0b073e6c66ed957a561c93c3d368e24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278893
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2021-11-19 08:17:01 -07:00
parent 1857af567a
commit c056882fb9
47 changed files with 25 additions and 124 deletions

View File

@ -211,6 +211,8 @@ Style/EachWithObject:
Severity: error
Style/EmptyCaseCondition:
Severity: error
Style/EmptyMethod:
Severity: error
Style/Encoding:
Severity: error
Style/ExpandPathArguments:

View File

@ -684,8 +684,7 @@ class CalendarEvent < ActiveRecord::Base
@event = event
end
def location
end
def location; end
def to_ics(in_own_calendar:, preloaded_attachments: {}, include_description: false, user_events: [])
cal = Icalendar::Calendar.new

View File

@ -1116,8 +1116,7 @@ class User < ActiveRecord::Base
self.reload
end
def associate_with_shard(shard, strength = :strong)
end
def associate_with_shard(shard, strength = :strong); end
def self.clone_communication_channel(cc, new_user, max_position)
new_cc = cc.clone
@ -2996,8 +2995,7 @@ class User < ActiveRecord::Base
%w[student teacher ta observer].include?(type) ? type : nil
end
def self.preload_shard_associations(users)
end
def self.preload_shard_associations(users); end
def associated_shards(strength = :strong)
strength == :strong ? [Shard.default] : []

View File

@ -286,8 +286,7 @@ class WebConference < ActiveRecord::Base
read_attribute(:context_code) || "#{self.context_type.underscore}_#{self.context_id}" rescue nil
end
def infer_conference_settings
end
def infer_conference_settings; end
def conference_type=(val)
conf_type = if val == 'LtiConference'

View File

@ -262,8 +262,7 @@ class ToDoListPresenter
I18n.t('Ignore %{assignment}', :assignment => @assignment.title)
end
def ignore_flash_message
end
def ignore_flash_message; end
def submission_author_name
@view.submission_author_name_for(@assessment_request, "#{I18n.t('user')}: ")

View File

@ -303,8 +303,7 @@ module CanvasRails
end
class DummyKeyGenerator
def self.generate_key(*)
end
def self.generate_key(*); end
end
def key_generator

View File

@ -43,7 +43,4 @@ class ValidateMigrationIntegrity < ActiveRecord::Migration[4.2]
TEXT
end
end
def self.down
end
end

View File

@ -23,7 +23,4 @@ class FixOverwrittenFileModuleItems < ActiveRecord::Migration[4.2]
def up
DataFixup::FixOverwrittenFileModuleItems.delay_if_production(priority: Delayed::LOW_PRIORITY).run
end
def down
end
end

View File

@ -24,7 +24,4 @@ class FixNanGroupWeights < ActiveRecord::Migration[4.2]
DataFixup::FixNanGroupWeights.delay_if_production(priority: Delayed::LOWER_PRIORITY,
n_strand: "data_fixups:#{Shard.current.database_server.id}").run
end
def down
end
end

View File

@ -28,7 +28,4 @@ class MakeEnrolllmentStateLockNotNull < ActiveRecord::Migration[4.2]
end
change_column_null(:enrollment_states, :lock_version, false)
end
def down
end
end

View File

@ -24,7 +24,4 @@ class FixPlannerOverridesMarkedCompleteData < ActiveRecord::Migration[4.2]
def self.up
DataFixup::FixPlannerOverridesMarkedCompleteData.delay_if_production(priority: Delayed::LOWER_PRIORITY).run
end
def self.down
end
end

View File

@ -25,7 +25,4 @@ class PopulateContextOnWikiPages < ActiveRecord::Migration[5.0]
def up
DataFixup::PopulateContextOnWikiPages.run
end
def down
end
end

View File

@ -26,7 +26,4 @@ class CreateLtiLinksForLegacyLtiToolSettings < ActiveRecord::Migration[5.0]
.delay_if_production(priority: Delayed::LOW_PRIORITY, n_strand: 'long_datafixups')
.run
end
def down
end
end

View File

@ -24,7 +24,4 @@ class MoveMasterImportResults < ActiveRecord::Migration[5.0]
def up
DataFixup::MoveMasterImportResults.delay_if_production(priority: Delayed::LOW_PRIORITY, n_strand: 'long_datafixups').run
end
def down
end
end

View File

@ -27,7 +27,4 @@ class PopulateTermsOfService < ActiveRecord::Migration[4.2]
TermsOfService.ensure_terms_for_account(ra)
end
end
def down
end
end

View File

@ -27,7 +27,4 @@ class ValidateAssignmentOverrides < ActiveRecord::Migration[5.0]
.run(start_at, end_at)
end
end
def self.down
end
end

View File

@ -24,7 +24,4 @@ class FixAssignmentPeerReviewJobs < ActiveRecord::Migration[5.0]
def up
DataFixup::FixAssignmentPeerReviewJobs.delay_if_production(priority: Delayed::LOW_PRIORITY).run
end
def down
end
end

View File

@ -25,7 +25,4 @@ class FixDiscussionTopicMaterializedViews < ActiveRecord::Migration[5.0]
.delay_if_production(priority: Delayed::LOW_PRIORITY, n_strand: 'long_datafixups')
.run
end
def down
end
end

View File

@ -24,7 +24,4 @@ class DeleteEmptyAdhocAssignmentOverrides < ActiveRecord::Migration[5.0]
def up
DataFixup::DeleteEmptyAdhocAssignmentOverrides.run
end
def down
end
end

View File

@ -6,7 +6,4 @@ class PopulateRootAccountIdOnUserObservers < ActiveRecord::Migration[5.0]
def up
DataFixup::PopulateRootAccountIdOnUserObservers.run
end
def down
end
end

View File

@ -27,7 +27,4 @@ class PopulateLastCommentAtOnSubmissions < ActiveRecord::Migration[5.0]
n_strand: ['DataFixup::PopulateLastCommentAtOnSubmissions', Shard.current.database_server.id]).run(start_at, end_at)
end
end
def down
end
end

View File

@ -6,7 +6,4 @@ class AddCreateForumPermissionOverrides < ActiveRecord::Migration[5.1]
def up
DataFixup::AddRoleOverridesForNewPermission.run(:post_to_forum, :create_forum)
end
def down
end
end

View File

@ -25,7 +25,4 @@ class PopulateFinalGradeOverrideCourseSetting < ActiveRecord::Migration[5.1]
raise "DataFixup::PopulateFinalGradeOverrideCourseSetting needs to be run on a previous release"
end
end
def down
end
end

View File

@ -6,7 +6,4 @@ class AddViewFeatureFlagsPermissionOverrides < ActiveRecord::Migration[5.2]
def up
DataFixup::AddRoleOverridesForNewPermission.run(:manage_feature_flags, :view_feature_flags)
end
def down
end
end

View File

@ -24,7 +24,4 @@ class CopyBigBlueButtonSettings < ActiveRecord::Migration[5.2]
def up
DataFixup::CopyBigBlueButtonSettings.run
end
def down
end
end

View File

@ -11,7 +11,4 @@ class PopulateCourseIdOnSubmissions < ActiveRecord::Migration[5.2]
.run(start_at, end_at)
end
end
def down
end
end

View File

@ -27,7 +27,4 @@ class CopyBuiltInRolesByRootAccount < ActiveRecord::Migration[5.2]
def up
DataFixup::CopyBuiltInRolesByRootAccount.run
end
def down
end
end

View File

@ -28,7 +28,4 @@ class CleanupCrossShardDeveloperKeys < ActiveRecord::Migration[5.2]
def up
DataFixup::CleanupCrossShardDeveloperKeys.delay_if_production(priority: Delayed::LOW_PRIORITY, n_strand: 'long_datafixups').run
end
def down
end
end

View File

@ -42,7 +42,4 @@ class InvalidateBuiltInRoleCaches < ActiveRecord::Migration[5.2]
&.clear_downstream_caches(:role_overrides)
end
end
def down
end
end

View File

@ -25,7 +25,4 @@ class MoveRceFavoritesToAccountSettings < ActiveRecord::Migration[5.2]
DataFixup::MoveRceFavoritesToAccountSettings.delay_if_production(priority: Delayed::LOW_PRIORITY,
n_strand: ["rce_favorites_fixup", Shard.current.database_server.id]).run
end
def down
end
end

View File

@ -28,7 +28,4 @@ class PopulateRootAccountIdOnModels < ActiveRecord::Migration[5.2]
DataFixup::PopulateRootAccountIdOnModels.delay_if_production(priority: Delayed::LOWER_PRIORITY,
singleton: "root_account_id_backfill_strand_#{Shard.current.id}").run
end
def down
end
end

View File

@ -27,7 +27,4 @@ class ClearRailsCache < ActiveRecord::Migration[4.2]
def up
Rails.cache.clear if Shard.current.default?
end
def down
end
end

View File

@ -27,7 +27,4 @@ class ClearRailsCache2 < ActiveRecord::Migration[4.2]
def up
Rails.cache.clear if Shard.current.default?
end
def down
end
end

View File

@ -24,7 +24,4 @@ class PopulateHomeroomCourseColumns < ActiveRecord::Migration[6.0]
def up
DataFixup::MigrateHomeroomSettingsToColumns.run
end
def down
end
end

View File

@ -23,7 +23,4 @@ class ChangeImmersiveReaderAllowedOnToOn < ActiveRecord::Migration[6.0]
def self.up
DataFixup::ChangeImmersiveReaderAllowedOnToOn.run
end
def self.down
end
end

View File

@ -21,8 +21,7 @@
require "spec_helper"
class TestLogger
def debug(*args)
end
def debug(*); end
end
# TODO: this spec that interacts directly with the parent app should probably go

View File

@ -67,8 +67,7 @@ module CanvasPartman
#
# @param [Integer] number_to_keep
# The number of partitions to keep (excluding the current partition)
def prune_partitions(_number_to_keep = 6)
end
def prune_partitions(_number_to_keep = 6); end
# Create a new partition table.
#

View File

@ -28,7 +28,7 @@ describe EventStream::Backend::Cassandra do
yield
end
def database.update_record(*args); end
def database.update_record(*); end
def database.insert_record(*args)
@inserted ||= []
@ -41,7 +41,7 @@ describe EventStream::Backend::Cassandra do
end
# rubocop:enable Style/TrivialAccessors
def database.update(*args); end
def database.update(*); end
def database.available?
true

View File

@ -28,11 +28,9 @@ describe EventStream::Index do
yield
end
def @database.update_record(*args)
end
def @database.update_record(*); end
def @database.update(*args)
end
def @database.update(*); end
def @database.keyspace
'test_db'

View File

@ -28,9 +28,9 @@ describe EventStream::IndexStrategy::Cassandra do
yield
end
def @database.update_record(*args); end
def @database.update_record(*); end
def @database.update(*args); end
def @database.update(*); end
def @database.keyspace
'test_db'

View File

@ -28,11 +28,11 @@ describe EventStream::Stream do
yield
end
def database.update_record(*args); end
def database.update_record(*); end
def database.insert_record(*args); end
def database.insert_record(*); end
def database.update(*args); end
def database.update(*); end
def database.available?
true

View File

@ -44,8 +44,7 @@ module IncomingMailProcessor
@incoming_mail_queue = Aws::SQS::QueuePoller.new(@queue_url, client: @sqs)
end
def disconnect
end
def disconnect; end
def each_message(**)
start_time = Time.now

View File

@ -20,7 +20,6 @@
module CC::Exporter::WebZip
class Exporter < CC::Exporter::Epub::Exporter
# override epub exporter templates
def templates
end
def templates; end
end
end

View File

@ -24,7 +24,7 @@ describe Canvas::LockExplanation do
Class.new {
include Rails.application.routes.url_helpers
include Canvas::LockExplanation
def js_bundle(*args); end
def js_bundle(*); end
}
}
let(:host) { klass.new }

View File

@ -26,7 +26,7 @@ describe Mutable do
# them
def muted?; end
def update_attribute(*args); end
def update_attribute(*); end
def save!; end

View File

@ -39,8 +39,7 @@ describe RootAccountResolver do
attributes.key?(key)
end
def self.belongs_to(relation, **opts)
end
def self.belongs_to(relation, **opts); end
end
end
let(:test_class) do

View File

@ -25,8 +25,7 @@ module Onceler
end
module ClassMethods
def onceler!
end
def onceler!; end
def before(scope = nil, &block)
scope = :each if scope == :once || scope.nil?