From 28fdf933626c99566b0881cb4cb741f595c83644 Mon Sep 17 00:00:00 2001
From: Matt Jankowski <matt@jankowski.online>
Date: Fri, 12 Jan 2024 08:10:14 -0500
Subject: [PATCH] Disable `Rails/LexicallyScopedActionFilter` for inherited
 auth controllers (#28711)

---
 .rubocop.yml      | 6 ++++++
 .rubocop_todo.yml | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/.rubocop.yml b/.rubocop.yml
index bedd8f785..a06621d66 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -103,6 +103,12 @@ Rails/Exit:
     - 'config/boot.rb'
     - 'lib/mastodon/cli/*.rb'
 
+# Reason: Conflicts with `Lint/UselessMethodDefinition` for inherited controller actions
+# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railslexicallyscopedactionfilter
+Rails/LexicallyScopedActionFilter:
+  Exclude:
+    - 'app/controllers/auth/*'
+
 Rails/SkipsModelValidations:
   Exclude:
     - 'db/*migrate/**/*'
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bf4a9a09f..602d99c9f 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -64,13 +64,6 @@ Rails/HasAndBelongsToMany:
     - 'app/models/status.rb'
     - 'app/models/tag.rb'
 
-# Configuration parameters: Include.
-# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
-Rails/LexicallyScopedActionFilter:
-  Exclude:
-    - 'app/controllers/auth/passwords_controller.rb'
-    - 'app/controllers/auth/registrations_controller.rb'
-
 Rails/OutputSafety:
   Exclude:
     - 'config/initializers/simple_form.rb'