rubocop: disable Rails/ContentTag for migrations

Change-Id: I44d4c789fe539158a74143de6665caa0c6e73977
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274676
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-09-28 12:21:00 -06:00
parent 4e7832206d
commit 117d484c1c
4 changed files with 10 additions and 3 deletions

View File

@ -55,6 +55,11 @@ Rails/HasManyOrHasOneDependent:
Enabled: false # legacy code + most things we soft delete anyway
Rails/SkipsModelValidations:
Enabled: false # Canvas skips validations in many places for optimization reasons
Rails/ContentTag:
Severity: error
Exclude:
- "**/db/migrate/*" # this cop is for views, not migrations, where it gets confused with outrigger
- "doc/**/*"
RSpec/DescribedClass:
Enabled: false # we haven't used it, and it seems antithetical to RSpec/NamedSubject

View File

@ -937,13 +937,13 @@ module ApplicationHelper
output = []
if @meta_tags.present?
output = @meta_tags.map { |meta_attrs| tag("meta", meta_attrs) }
output = @meta_tags.map { |meta_attrs| tag.meta(meta_attrs) }
end
# set this if you want android users of your site to be prompted to install an android app
# you can see an example of the one that instructure uses in InfoController#web_app_manifest
manifest_url = Setting.get('web_app_manifest_url', '')
output << tag("link", rel: 'manifest', href: manifest_url) if manifest_url.present?
output << tag.link(rel: 'manifest', href: manifest_url) if manifest_url.present?
output.join("\n").html_safe.presence
end

View File

@ -23,6 +23,7 @@ require 'will_paginate/core_ext'
require 'will_paginate/view_helpers'
require 'will_paginate/view_helpers/link_renderer_base'
# rubocop:disable Rails/ContentTag this is not the Rails `tag` method in this file
module WillPaginateHelper
class AccessibleLinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
@ -54,3 +55,4 @@ module WillPaginateHelper
end
end
end
# rubocop:enable Rails/ContentTag

View File

@ -61,7 +61,7 @@ module Canvas
end
def self.included(migration)
migration.tag :cassandra
migration.tag :cassandra # rubocop:disable Rails/ContentTag this is Outrigger's tag, not Rails'
migration.singleton_class.include(ClassMethods)
end
end