Skip to content

Commit 32791a6

Browse files
authored
Merge pull request #223 from hoshinotsuyoshi/application-controller-unsafe
Mark `Rails/ApplicationController` and similar cops as unsafe autocorrect
2 parents ad4e97d + a1aa7d5 commit 32791a6

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* [#214](https://github.com/rubocop-hq/rubocop-rails/issues/214): Fix an error for `Rails/UniqueValidationWithoutIndex`when a table has no column definition. ([@koic][])
1010
* [#221](https://github.com/rubocop-hq/rubocop-rails/issues/221): Make `Rails/UniqueValidationWithoutIndex` aware of `add_index` in db/schema.rb. ([@koic][])
1111

12+
### Changes
13+
14+
* [#223](https://github.com/rubocop-hq/rubocop-rails/pull/223): Mark `Rails/ApplicationController`, `Rails/ApplicationJob`, `Rails/ApplicationMailer`, and `Rails/ApplicationRecord` as unsafe autocorrect. ([@hoshinotsuyoshi][])
15+
1216
## 2.5.0 (2020-03-24)
1317

1418
### New features
@@ -157,3 +161,4 @@
157161
[@joshpencheon]: https://github.com/joshpencheon
158162
[@djudd]: https://github.com/djudd
159163
[@sunny]: https://github.com/sunny
164+
[@hoshinotsuyoshi]: https://github.com/hoshinotsuyoshi

config/default.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,30 @@ Rails/ActiveSupportAliases:
5757
Rails/ApplicationController:
5858
Description: 'Check that controllers subclass ApplicationController.'
5959
Enabled: true
60+
SafeAutoCorrect: false
6061
VersionAdded: '2.4'
62+
VersionChanged: '2.5'
6163

6264
Rails/ApplicationJob:
6365
Description: 'Check that jobs subclass ApplicationJob.'
6466
Enabled: true
67+
SafeAutoCorrect: false
6568
VersionAdded: '0.49'
69+
VersionChanged: '2.5'
6670

6771
Rails/ApplicationMailer:
6872
Description: 'Check that mailers subclass ApplicationMailer.'
6973
Enabled: true
74+
SafeAutoCorrect: false
7075
VersionAdded: '2.4'
76+
VersionChanged: '2.5'
7177

7278
Rails/ApplicationRecord:
7379
Description: 'Check that models subclass ApplicationRecord.'
7480
Enabled: true
81+
SafeAutoCorrect: false
7582
VersionAdded: '0.49'
83+
VersionChanged: '2.5'
7684

7785
Rails/AssertNot:
7886
Description: 'Use `assert_not` instead of `assert !`.'

manual/cops_rails.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ are not used.
131131

132132
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
133133
--- | --- | --- | --- | ---
134-
Enabled | Yes | Yes | 2.4 | -
134+
Enabled | Yes | Yes (Unsafe) | 2.4 | 2.5
135135

136136
This cop checks that controllers subclass ApplicationController.
137137

@@ -153,7 +153,7 @@ end
153153

154154
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
155155
--- | --- | --- | --- | ---
156-
Enabled | Yes | Yes | 0.49 | -
156+
Enabled | Yes | Yes (Unsafe) | 0.49 | 2.5
157157

158158
This cop checks that jobs subclass ApplicationJob with Rails 5.0.
159159

@@ -175,7 +175,7 @@ end
175175

176176
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
177177
--- | --- | --- | --- | ---
178-
Enabled | Yes | Yes | 2.4 | -
178+
Enabled | Yes | Yes (Unsafe) | 2.4 | 2.5
179179

180180
This cop checks that mailers subclass ApplicationMailer with Rails 5.0.
181181

@@ -197,7 +197,7 @@ end
197197

198198
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
199199
--- | --- | --- | --- | ---
200-
Enabled | Yes | Yes | 0.49 | -
200+
Enabled | Yes | Yes (Unsafe) | 0.49 | 2.5
201201

202202
This cop checks that models subclass ApplicationRecord with Rails 5.0.
203203

0 commit comments

Comments
 (0)