Skip to content

Commit

Permalink
Fix autocorrectable Layout offenses
Browse files Browse the repository at this point in the history
- Uses `rubocop --only Layout/CommentIndentation,Layout/IndentationWidth,Layout/MultilineMethodCallBraceLayout -a`
- Deletes the corrected offenses from the Rubocop TODO file
  • Loading branch information
JoeCohen committed Feb 21, 2024
1 parent 0ffe8ac commit 246707d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
26 changes: 1 addition & 25 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowForAlignment.
Layout/CommentIndentation:
Exclude:
- 'app/helpers/matrix_box_helper.rb'
- 'app/helpers/tabs/descriptions_helper.rb'
- 'script/refresh_caches'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Exclude:
- 'app/helpers/matrix_box_helper.rb'

# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
Expand All @@ -30,15 +14,7 @@ Layout/LineLength:
Exclude:
- 'lib/core_extensions/action_view/log_subscriber.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'app/helpers/matrix_box_helper.rb'

# Offense count: 3
## Offense count: 3
Lint/DuplicateMethods:
Exclude:
- 'app/classes/query/modules/active_record.rb'
Expand Down
7 changes: 4 additions & 3 deletions app/helpers/matrix_box_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def render_cached_matrix_boxes(objects, locals)
# css hides image vote ui when body.no-user
objects.each do |object|
# cache(object) do
concat(render(partial: "shared/matrix_box",
locals: { object: object }.merge(locals)))
concat(render(partial: "shared/matrix_box",
locals: { object: object }.merge(locals)))
# end
end
end
Expand Down Expand Up @@ -135,7 +135,8 @@ def matrix_box_vote_or_propose_ui(identify, object, consensus)
else
propose_naming_link(
object.id, btn_class: "btn btn-default d-inline-block mb-3",
context: "matrix_box")
context: "matrix_box"
)
end
end

Expand Down
18 changes: 9 additions & 9 deletions app/helpers/tabs/descriptions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def show_description_tabs(description:)
# admin = is_admin?(description)
# assemble HTML for "tabset" for show_{type}_description
# [
# description_parent_tab(description, type)
# edit_description_tab(description, type),
# destroy_description_tab(description, admin),
# clone_description_tab(description, type),
# merge_description_tab(description, type, admin),
# adjust_description_permissions_tab(description, type, admin),
# make_description_default_tab(description, type),
# description_project_tab(description),
# publish_description_draft_tab(description, type, admin)
# description_parent_tab(description, type)
# edit_description_tab(description, type),
# destroy_description_tab(description, admin),
# clone_description_tab(description, type),
# merge_description_tab(description, type, admin),
# adjust_description_permissions_tab(description, type, admin),
# make_description_default_tab(description, type),
# description_project_tab(description),
# publish_description_draft_tab(description, type, admin)
# ].reject(&:empty?)
end

Expand Down
4 changes: 2 additions & 2 deletions script/refresh_caches
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ msgs = progress("unused or missing synonyms...",
Name, :make_sure_names_are_bolded_correctly) +
progress("classification caches...",
Name, :refresh_classification_caches) +
# progress("generic classifications...",
# Name, :propagate_generic_classifications) +
# progress("generic classifications...",
# Name, :propagate_generic_classifications) +
progress("misspelled observations...",
Observation, :make_sure_no_observations_are_misspelled) +
progress("content filter caches...",
Expand Down

0 comments on commit 246707d

Please sign in to comment.