rubocop: a few fixes

* disable Layout/LineLength for now; it's not auto-correctable, and we have a
   LOT of violations
 * add a comment showing how to generate the final RuboCop enforced config
 * fix forcing of error level for gergich
 * fix boyscout mode always being on

Change-Id: Ie68b612f107e9e98b50a230a65ef2a616751362d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274008
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@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-21 10:33:49 -06:00
parent dd814ee5a2
commit 8b690ddc32
5 changed files with 8 additions and 5 deletions

View File

@ -20,6 +20,8 @@ Gemspec/OrderedDependencies:
Layout/IndentationConsistency: Layout/IndentationConsistency:
Exclude: Exclude:
- "**/Gemfile.d/*" # we purposely indent dependent gems - "**/Gemfile.d/*" # we purposely indent dependent gems
Layout/LineLength:
Enabled: false
Lint/Debugger: Lint/Debugger:
Severity: error Severity: error

View File

@ -9,6 +9,9 @@ AllCops:
<%= <%=
# if you want to see what this all evaluates to, you can run
# `require 'erb'; puts ERB.new(File.read(".rubocop.enforced.yml")).result(binding)` from IRB
# keys are cops you want to opt in for (nil being all cops) # keys are cops you want to opt in for (nil being all cops)
# values are an array of directories to opt in for (nil being all directories) # values are an array of directories to opt in for (nil being all directories)
OPT_IN = { OPT_IN = {

View File

@ -87,7 +87,6 @@ class Linter
:campsite_mode, :campsite_mode,
:command, :command,
:comment_post_processing, :comment_post_processing,
:default_boyscout_mode,
:custom_comment_generation, :custom_comment_generation,
:env_sha, :env_sha,
:file_regex, :file_regex,
@ -164,7 +163,7 @@ class Linter
if gerrit_patchset if gerrit_patchset
if boyscout_mode if boyscout_mode
processed_comments.each do |comment| processed_comments.each do |comment|
comment[:severity] = :error comment[:severity] = 'error'
end end
end end
publish_gergich_comments(processed_comments) publish_gergich_comments(processed_comments)

View File

@ -15,7 +15,7 @@ linter_options = {
campsite_mode: false, campsite_mode: false,
append_files_to_command: true, append_files_to_command: true,
severe_levels: [], severe_levels: [],
default_boyscout_mode: false, boyscout_mode: false,
heavy_mode_proc: proc do |ruby_files| heavy_mode_proc: proc do |ruby_files|
args = ruby_files args = ruby_files
args_index = ARGV.index('--') args_index = ARGV.index('--')

View File

@ -9,8 +9,7 @@ linter_options = {
format: 'stylelint', format: 'stylelint',
command: 'node_modules/.bin/stylelint', command: 'node_modules/.bin/stylelint',
campsite_mode: false, campsite_mode: false,
append_files_to_command: true, append_files_to_command: true
default_boyscout_mode: false
} }
stylelint = Linter.new(linter_options) stylelint = Linter.new(linter_options)