Class: Gitlab::Styles::Rubocop::Cop::Rails::IncludeUrlHelper
- Inherits:
-
RuboCop::Cop::Cop
- Object
- RuboCop::Cop::Cop
- Gitlab::Styles::Rubocop::Cop::Rails::IncludeUrlHelper
- Defined in:
- lib/gitlab/styles/rubocop/cop/rails/include_url_helper.rb
Constant Summary collapse
- MSG =
"Avoid including `ActionView::Helpers::UrlHelper`.\nIt adds/overrides ~40 methods while usually only one is needed.\nInstead, use the `Gitlab::Routing.url_helpers`/`Application.routes.url_helpers`(outside of gitlab)\nand `ActionController::Base.helpers.link_to`.\nSee https://gitlab.com/gitlab-org/gitlab/-/issues/340567.\n"
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
23 24 25 |
# File 'lib/gitlab/styles/rubocop/cop/rails/include_url_helper.rb', line 23 def on_send(node) add_offense(node) if include_url_helpers_node?(node) end |