From 866247a06d9ab5c4312e20ae5b6d0526ea9bf10a Mon Sep 17 00:00:00 2001 From: r7kamura Date: Mon, 14 Jul 2025 17:16:07 +0900 Subject: [PATCH] Exclude controllers and mailers from `Lint/UselessMethodDefinition` --- changelog/change_exclude_controllers_and_mailers_from.md | 1 + config/default.yml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 changelog/change_exclude_controllers_and_mailers_from.md diff --git a/changelog/change_exclude_controllers_and_mailers_from.md b/changelog/change_exclude_controllers_and_mailers_from.md new file mode 100644 index 0000000000..499f02d10f --- /dev/null +++ b/changelog/change_exclude_controllers_and_mailers_from.md @@ -0,0 +1 @@ +* [#1500](https://github.com/rubocop/rubocop-rails/pull/1500): Exclude controllers and mailers from `Lint/UselessMethodDefinition`. ([@r7kamura][]) diff --git a/config/default.yml b/config/default.yml index 26a00ce501..73478937b5 100644 --- a/config/default.yml +++ b/config/default.yml @@ -91,6 +91,12 @@ Lint/UselessAccessModifier: - concern - concerning +Lint/UselessMethodDefinition: + # Avoids conflict with `Rails/LexicallyScopedActionFilter` cop. + Exclude: + - '**/app/controllers/**/*.rb' + - '**/app/mailers/**/*.rb' + Rails: Enabled: true DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails