From 91811bd54c48bc9348f27bd4d36ff3c065dfea4d Mon Sep 17 00:00:00 2001 From: ojab Date: Fri, 27 May 2022 20:25:28 +0300 Subject: [PATCH] Add jobs & mailers to default `filter`/`action` callbacks cops They use the same `filter`/`action` API. --- ...hange_enable_action_filter_cop_for_jobs_and_mailers.md | 1 + config/default.yml | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/change_enable_action_filter_cop_for_jobs_and_mailers.md diff --git a/changelog/change_enable_action_filter_cop_for_jobs_and_mailers.md b/changelog/change_enable_action_filter_cop_for_jobs_and_mailers.md new file mode 100644 index 0000000000..1ea7c82fa5 --- /dev/null +++ b/changelog/change_enable_action_filter_cop_for_jobs_and_mailers.md @@ -0,0 +1 @@ +* [#705](https://github.com/rubocop/rubocop-rails/pull/705): Add jobs & mailers to default `filter`/`action` callbacks cops. ([@ojab][]) diff --git a/config/default.yml b/config/default.yml index 09b40ecc50..aeb9f1968e 100644 --- a/config/default.yml +++ b/config/default.yml @@ -60,6 +60,8 @@ Rails/ActionFilter: - filter Include: - app/controllers/**/*.rb + - app/jobs/**/*.rb + - app/mailers/**/*.rb Rails/ActiveRecordAliases: Description: >- @@ -477,6 +479,8 @@ Rails/IgnoredSkipActionFilterOption: VersionAdded: '0.63' Include: - app/controllers/**/*.rb + - app/jobs/**/*.rb + - app/mailers/**/*.rb Rails/IndexBy: Description: 'Prefer `index_by` over `each_with_object`, `to_h`, or `map`.' @@ -505,13 +509,15 @@ Rails/InverseOf: - app/models/**/*.rb Rails/LexicallyScopedActionFilter: - Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller." + Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the class." StyleGuide: 'https://rails.rubystyle.guide#lexically-scoped-action-filter' Enabled: true Safe: false VersionAdded: '0.52' Include: - app/controllers/**/*.rb + - app/jobs/**/*.rb + - app/mailers/**/*.rb Rails/LinkToBlank: Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` option passed to them.'