From de9a5590ec3a6976d575df512696a090805b2b20 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:20:04 +0100 Subject: [PATCH] Make `Lint/UselessAccessModifier` aware of `ActiveSupport::Concern` --- ...ange_lint_useless_access_modifier_as_concern.md | 1 + config/default.yml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 changelog/change_lint_useless_access_modifier_as_concern.md diff --git a/changelog/change_lint_useless_access_modifier_as_concern.md b/changelog/change_lint_useless_access_modifier_as_concern.md new file mode 100644 index 0000000000..383a6ac899 --- /dev/null +++ b/changelog/change_lint_useless_access_modifier_as_concern.md @@ -0,0 +1 @@ +* [#1385](https://github.com/rubocop/rubocop-rails/pull/1385): Make `Lint/UselessAccessModifier` aware of `ActiveSupport::Concern` and `Module#concerning`/`Module#concern` core extensions. ([@earlopain][]) diff --git a/config/default.yml b/config/default.yml index 0e7d183460..7159b42386 100644 --- a/config/default.yml +++ b/config/default.yml @@ -73,6 +73,20 @@ Lint/SafeNavigationChain: - try! - in? +Lint/UselessAccessModifier: + # Add methods from `ActiveSupport::Concern` and `Module::Concerning`: + # https://api.rubyonrails.org/classes/ActiveSupport/Concern.html + # https://api.rubyonrails.org/classes/Module/Concerning + inherit_mode: + merge: + - ContextCreatingMethods + ContextCreatingMethods: + - class_methods + - included + - prepended + - concern + - concerning + Rails: Enabled: true DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails