Improvements to unused helper methods linter
The following discussions from !139028 (merged) should be addressed:
-
@splattael started a discussion: (+2 comments) Question Do we need handle method name duplicates?
🤔 p helpers.map { |x| x[:method] }.size # => 2463 p helpers.map { |x| x[:method] }.uniq.size # => 2285
-
@splattael started a discussion: (+1 comment) Question Do we care about
lib
?🤔 I see some use of method helpers in
lib/api
, for example:repository_mirror_attributes
:attrs = attrs.except(*::EE::ApplicationSettingsHelper.repository_mirror_attributes)
expose(*EE::ApplicationSettingsHelper.repository_mirror_attributes, if: ->(_instance, _options) do
See also #330633 (comment 573421455).
-
@splattael started a discussion: (+2 comments) Suggestion Could we use
filter_map
instead?🤔 unused = Parallel.filter_map(helpers, progress: 'Checking helpers') do |helper| helper unless /(?<!def )#{helper[:method]}/.match?(source_code)
Edited by Peter Leitzen