From 75edcaa4d51998dacdcc96c76775f6a789eea627 Mon Sep 17 00:00:00 2001 From: Simon Coffey Date: Wed, 3 Apr 2019 21:21:23 +0100 Subject: [PATCH] Mark Rails/LexicallyScopedActionFilter as unsafe In the previous commit we documented an inheritance case in which the Rails/LexicallyScopedActionFilter cop recommends unsafe edits that have semantic implications. Since not everyone will see the documentation examples, we're also marking the cop as unsafe to signal that its recommendations should be treated carefully. --- CHANGELOG.md | 1 + config/default.yml | 1 + manual/cops_rails.md | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 311426b09c2..703b288079d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ ### Changes +* [#6854](https://github.com/rubocop-hq/rubocop/pull/6854): Mark Rails/LexicallyScopedActionFilter as unsafe and document risks. ([@urbanautomaton][]) * [#5977](https://github.com/rubocop-hq/rubocop/issues/5977): Warn for Performance Cops. ([@koic][]) * [#6637](https://github.com/rubocop-hq/rubocop/issues/6637): Move `LstripRstrip` from `Performance` to `Style` department and rename it to `Strip`. ([@anuja-joshi][]) diff --git a/config/default.yml b/config/default.yml index 148b492cec8..1f3552155fe 100644 --- a/config/default.yml +++ b/config/default.yml @@ -2445,6 +2445,7 @@ Rails/LexicallyScopedActionFilter: Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller." StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter' Enabled: true + Safe: false VersionAdded: '0.52' Include: - app/controllers/**/*.rb diff --git a/manual/cops_rails.md b/manual/cops_rails.md index cef62e3fe0f..7223cf1addf 100644 --- a/manual/cops_rails.md +++ b/manual/cops_rails.md @@ -1164,7 +1164,7 @@ Include | `app/models/**/*.rb` | Array Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged --- | --- | --- | --- | --- -Enabled | Yes | No | 0.52 | - +Enabled | No | No | 0.52 | - This cop checks that methods specified in the filter's `only` or `except` options are defined within the same class or module.