Skip to content

Commit

Permalink
Observe todo file's Exclude's
Browse files Browse the repository at this point in the history
RuboCop was ignoring some of the todo file's Exclude's. This PR fixes most of that
- Applies the workaround suggested [here](rubocop/rubocop#13091 (comment)) and [here](rubocop/rubocop#9325 (comment))
- regenerates RuboCop todo file
- removes now-unnecessary `disable`'s in `app/helpers/forms_helper.rb`
- inlines the remaing `disable`; using the inline gives us one fewer place to change in case we want to remove this temporararily or permanently.
  • Loading branch information
JoeCohen committed Aug 8, 2024
1 parent 99db4e9 commit 4a3114a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude

require:
- rubocop-performance
Expand Down Expand Up @@ -178,7 +181,7 @@ Rails/WhereExists:
Style/AccessorGrouping:
# https://github.com/MushroomObserver/mushroom-observer/pull/988
Enabled: false
# The followin Exclude in case we re-enable the cop
# The following are Exclude in case we re-enable the cop
# Exclude files that individually comment accessors
# else Rubocop concatenates the accessors and comments on a single line.
# Disabling Style/AccessorGrouping around the accessors doesn't
Expand Down
14 changes: 6 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit`
# on 2024-08-01 19:59:56 UTC using RuboCop version 1.65.1.
# `rubocop --auto-gen-config --no-exclude-limit`
# on 2024-08-08 16:15:46 UTC using RuboCop version 1.65.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -277,7 +277,7 @@ Metrics/AbcSize:
- 'script/refresh_sitemap'
- 'script/update_ip_stats.rb'

# Offense count: 32
# Offense count: 31
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Expand All @@ -287,7 +287,6 @@ Metrics/BlockLength:
- 'app/controllers/concerns/descriptions/moves.rb'
- 'app/controllers/concerns/descriptions/publish.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/helpers/forms_helper.rb'
- 'app/views/controllers/api2/_image.xml.builder'
- 'app/views/controllers/api2/_name.xml.builder'
- 'app/views/controllers/api2/_observation.xml.builder'
Expand Down Expand Up @@ -320,7 +319,7 @@ Metrics/ClassLength:
- 'app/models/abstract_model.rb'
- 'app/models/description.rb'

# Offense count: 122
# Offense count: 121
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
Expand Down Expand Up @@ -403,7 +402,7 @@ Metrics/CyclomaticComplexity:
- 'script/bulk_name_change'
- 'script/update_ip_stats.rb'

# Offense count: 20
# Offense count: 19
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
Expand All @@ -416,7 +415,6 @@ Metrics/MethodLength:
- 'app/controllers/locations_controller.rb'
- 'app/controllers/names/eol_data/preview_controller.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/helpers/forms_helper.rb'
- 'app/helpers/pagination_helper.rb'
- 'app/models/image.rb'
- 'app/models/language_exporter.rb'
Expand Down Expand Up @@ -446,7 +444,7 @@ Metrics/ParameterLists:
- 'test/controllers/projects/members_controller_test.rb'
- 'test/models/collapsible_map_test.rb'

# Offense count: 94
# Offense count: 93
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
Expand Down
9 changes: 2 additions & 7 deletions app/helpers/forms_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
# date_select_opts

# helpers for form tags
# rubocop:disable Metrics/ModuleLength
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
module FormsHelper

module FormsHelper # rubocop:disable Metrics/ModuleLength
# Bootstrap submit button
# <%= submit_button(form: f, button: button.t, center: true) %>
def submit_button(**args)
Expand Down Expand Up @@ -548,6 +546,3 @@ def separate_field_options_from_args(args, extras = [])
args.clone.except(*exceptions)
end
end
# rubocop:enable Metrics/ModuleLength
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity

0 comments on commit 4a3114a

Please sign in to comment.