Skip to content

Commit

Permalink
Change "auto-correct" to "autocorrect"
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed May 15, 2022
1 parent 922de10 commit 3a93706
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $ rubocop -V
Here are a few examples:

```
* [#67](https://github.com/rubocop/rubocop-rails/issues/67): Fix an incorrect auto-correct for `Rails/TimeZone` when using `DateTime`. ([@koic][])
* [#67](https://github.com/rubocop/rubocop-rails/issues/67): Fix an incorrect autocorrect for `Rails/TimeZone` when using `DateTime`. ([@koic][])
* New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][])
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* [#703](https://github.com/rubocop/rubocop-rails/pull/703): Fix not auto-corrected for `Rails/DuplicateAssociation`. ([@ydah][])
* [#703](https://github.com/rubocop/rubocop-rails/pull/703): Fix not autocorrected for `Rails/DuplicateAssociation`. ([@ydah][])
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* [#688](https://github.com/rubocop/rubocop-rails/pull/688): Support auto-correction for `Rails/DeprecatedActiveModelErrorsMethods`. ([@koic][])
* [#688](https://github.com/rubocop/rubocop-rails/pull/688): Support autocorrection for `Rails/DeprecatedActiveModelErrorsMethods`. ([@koic][])
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ Rails/SquishedSQLHeredocs:
VersionAdded: '2.8'
VersionChanged: '2.9'
# Some SQL syntax (e.g. PostgreSQL comments and functions) requires newlines
# to be preserved in order to work, thus auto-correction is not safe.
# to be preserved in order to work, thus autocorrection is not safe.
SafeAutoCorrect: false

Rails/TableNameAssignment:
Expand Down
6 changes: 3 additions & 3 deletions lib/rubocop/cop/rails/blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ module Rails
# Interaction with `Style/UnlessElse`:
# The configuration of `NotPresent` will not produce an offense in the
# context of `unless else` if `Style/UnlessElse` is inabled. This is
# to prevent interference between the auto-correction of the two cops.
# to prevent interference between the autocorrection of the two cops.
#
# @safety
# This cop is unsafe auto-correction, because `' '.empty?` returns false,
# but `' '.blank?` returns true. Therefore, auto-correction is not compatible
# This cop is unsafe autocorrection, because `' '.empty?` returns false,
# but `' '.blank?` returns true. Therefore, autocorrection is not compatible
# if the receiver is a non-empty blank string, tab, or newline meta characters.
#
# @example NilOrEmpty: true (default)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/compact_blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Rails
# `ActionController::Parameters`.
# `Array#compact_blank!`, `Hash#compact_blank!` are equivalent to `delete_if(&:blank?)`.
# `ActionController::Parameters#compact_blank!` is equivalent to `reject!(&:blank?)`.
# If the cop makes a mistake, auto-corrected code may get unexpected behavior.
# If the cop makes a mistake, autocorrected code may get unexpected behavior.
#
# @example
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/present.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Rails
# Interaction with `Style/UnlessElse`:
# The configuration of `NotBlank` will not produce an offense in the
# context of `unless else` if `Style/UnlessElse` is inabled. This is
# to prevent interference between the auto-correction of the two cops.
# to prevent interference between the autocorrection of the two cops.
#
# @example NotNilAndNotEmpty: true (default)
# # Converts usages of `!nil? && !empty?` to `present?`
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/save_bang.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Rails
#
# update_attributes
#
# # After running rubocop --safe-auto-correct
# # After running rubocop --safe-autocorrect
# def update_attributes
# end
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/squished_sql_heredocs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Rails
#
# @safety
# Some SQL syntax (e.g. PostgreSQL comments and functions) requires newlines
# to be preserved in order to work, thus auto-correction for this cop is not safe.
# to be preserved in order to work, thus autocorrection for this cop is not safe.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/where_exists.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Rails
# `where(...).exists?` over `exists?(...)`.
#
# @safety
# This cop is unsafe for auto-correction because the behavior may change on the following case:
# This cop is unsafe for autocorrection because the behavior may change on the following case:
#
# [source,ruby]
# ----
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/rails/action_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
end
end

it 'auto-corrects to preferred method' do
it 'autocorrects to preferred method' do
new_source = autocorrect_source_file('before_filter :test')
expect(new_source).to eq('before_action :test')
end
Expand Down Expand Up @@ -95,7 +95,7 @@
end
end

it 'auto-corrects to preferred method' do
it 'autocorrects to preferred method' do
new_source = autocorrect_source_file('before_action :test')
expect(new_source).to eq('before_filter :test')
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rails/find_by_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{ 'IgnoreWhereFirst' => false }
end

it 'registers an offense when using `#first` and does not auto-correct' do
it 'registers an offense when using `#first` and does not autocorrect' do
expect_offense(<<~RUBY)
User.where(id: x).first
^^^^^^^^^^^^^^^^^^ Use `find_by` instead of `where.first`.
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rails/find_each_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Model < ApplicationRecord
RUBY
end

it 'auto-corrects each to find_each' do
it 'autocorrects each to find_each' do
expect_offense(<<~RUBY)
User.all.each { |u| u.x }
^^^^ Use `find_each` instead of `each`.
Expand Down
20 changes: 10 additions & 10 deletions spec/rubocop/cop/rails/http_positional_arguments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
end
end

it 'auto-corrects http action when method' do
it 'autocorrects http action when method' do
expect_offense(<<~RUBY)
post user_attrs, id: 1
^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -282,7 +282,7 @@
RUBY
end

it 'auto-corrects http action when symbol' do
it 'autocorrects http action when symbol' do
expect_offense(<<~RUBY)
post :user_attrs, id: 1
^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -293,7 +293,7 @@
RUBY
end

it 'maintains parentheses when auto-correcting' do
it 'maintains parentheses when autocorrecting' do
expect_offense(<<~RUBY)
post(:user_attrs, id: 1)
^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -304,7 +304,7 @@
RUBY
end

it 'maintains quotes when auto-correcting' do
it 'maintains quotes when autocorrecting' do
expect_offense(<<~RUBY)
get '/auth/linkedin/callback', id: 1
^^^^^ Use keyword arguments instead of positional arguments for http call: `get`.
Expand Down Expand Up @@ -337,7 +337,7 @@
RUBY
end

it 'auto-corrects http action when params is a method call' do
it 'autocorrects http action when params is a method call' do
expect_offense(<<~RUBY)
post :create, confirmation_data
^^^^^^^^^^^^^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -348,7 +348,7 @@
RUBY
end

it 'auto-corrects http action when parameter matches special keyword name' do
it 'autocorrects http action when parameter matches special keyword name' do
expect_offense(<<~RUBY)
post :create, id: 7, comment: { body: "hei" }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -359,7 +359,7 @@
RUBY
end

it 'auto-corrects http action when format keyword included but not alone' do
it 'autocorrects http action when format keyword included but not alone' do
expect_offense(<<~RUBY)
post :create, id: 7, format: :rss
^^^^^^^^^^^^^^^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -370,7 +370,7 @@
RUBY
end

it 'auto-corrects http action when params is a lvar' do
it 'autocorrects http action when params is a lvar' do
expect_offense(<<~RUBY)
params = { id: 1 }
post user_attrs, params
Expand All @@ -383,7 +383,7 @@
RUBY
end

it 'auto-corrects http action when params and action name are method calls' do
it 'autocorrects http action when params and action name are method calls' do
expect_offense(<<~RUBY)
post user_attrs, params
^^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand All @@ -394,7 +394,7 @@
RUBY
end

it 'auto-corrects http action when params is a method call with chain' do
it 'autocorrects http action when params is a method call with chain' do
expect_offense(<<~RUBY)
post user_attrs, params.merge(foo: bar)
^^^^^^^^^^^^^^^^^^^^^^ Use keyword arguments instead of positional arguments for http call: `post`.
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rails/link_to_blank_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
RUBY
end

it 'registers an offense and auto-corrects when using the block syntax' do
it 'registers an offense and autocorrects when using the block syntax' do
expect_offense(<<~RUBY)
link_to 'https://www.example.com', target: '_blank' do
^^^^^^^^^^^^^^^^ Specify a `:rel` option containing noopener.
Expand Down

0 comments on commit 3a93706

Please sign in to comment.