Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoveUnusedMethodsInHelpersCheck marks helper methods as unused after upgrade from HAML 5 to 6 #396

Open
oliverklee opened this issue Oct 21, 2022 · 0 comments

Comments

@oliverklee
Copy link
Contributor

oliverklee commented Oct 21, 2022

For our (private) project, we're currently in the process of upgrade from HAML 5 to 6.

After the upgrade, RBP marks all of our helper methods which we use in our HAML templates as unused.

This is an example:

##
# Icon view helper.
#
module IconViewHelper
  ##
  # Creates HTML for icons including screen reader texts.
  #
  # This method rightfully has a :reek:ControlParameter.
  #
  # @param [Boolean] icon_type true for "yes" and false for "no"
  #
  # @return [String] the rendered HTML
  #
  def icon_yes_or_no(icon_type)
    icon = icon_type ? 'check' : 'times'
    screen_reader_text_key = icon_type ? 'yes' : 'no'

    render partial: 'shared/accessible_icon', locals: {
      icon_file_name: icon,
      screen_reader_text: t("views.#{screen_reader_text_key}")
    }
  end
end
%td{ data: { scope: 'is-active' },
    content: organization.offerer.active?.to_s }
   != icon_yes_or_no organization.offerer.active?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant