Skip to content

Commit

Permalink
Replace "can not" with "cannot"
Browse files Browse the repository at this point in the history
This PR unifies wording.

cf. rails/rails#35503
  • Loading branch information
koic authored and bbatsov committed Dec 16, 2019
1 parent cc7e221 commit dff7052
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@
* [#1832](https://github.com/rubocop-hq/rubocop/pull/1832): Fix bug in `UnusedMethodArgument` that would cause them to report having been auto-corrected when they were not. ([@jonas054][])
* [#1834](https://github.com/rubocop-hq/rubocop/issues/1834): Support only boolean values for `AutoCorrect` configuration parameter, and remove warning for unknown parameter. ([@jonas054][])
* [#1843](https://github.com/rubocop-hq/rubocop/issues/1843): Fix crash in `TrailingBlankLines` when a file ends with a block comment without final newline. ([@jonas054][])
* [#1849](https://github.com/rubocop-hq/rubocop/issues/1849): Fix bug where you can not have nested arrays in the Rake task configuration. ([@rrosenblum][])
* [#1849](https://github.com/rubocop-hq/rubocop/issues/1849): Fix bug where you cannot have nested arrays in the Rake task configuration. ([@rrosenblum][])
* Fix bug in `MultilineTernaryOperator` where it will not register an offense when only the false branch is on a separate line. ([@rrosenblum][])
* Fix crash in `MultilineBlockLayout` when using new lambda literal syntax without parentheses. ([@hbd225][])
* [#1859](https://github.com/rubocop-hq/rubocop/pull/1859): Fix bugs in `IfUnlessModifier` concerning comments and empty lines. ([@jonas054][])
Expand Down Expand Up @@ -2726,7 +2726,7 @@

* [#801](https://github.com/rubocop-hq/rubocop/issues/801): New style `context_dependent` for `Style/BracesAroundHashParameters` looks at preceding parameter to determine if braces should be used for final parameter. ([@jonas054][])
* [#1427](https://github.com/rubocop-hq/rubocop/issues/1427): Excluding directories on the top level is now done earlier, so that these file trees are not searched, thus saving time when inspecting projects with many excluded files. ([@jonas054][])
* [#1325](https://github.com/rubocop-hq/rubocop/issues/1325): When running with `--auto-correct`, only offenses *that can not be corrected* will result in a non-zero exit code. ([@jonas054][])
* [#1325](https://github.com/rubocop-hq/rubocop/issues/1325): When running with `--auto-correct`, only offenses *that cannot be corrected* will result in a non-zero exit code. ([@jonas054][])
* [#1445](https://github.com/rubocop-hq/rubocop/issues/1445): Allow sprockets directive comments (starting with `#=`) in `Style/LeadingCommentSpace`. ([@bbatsov][])

### Bugs fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def file_to_include?(file)
relative_file_path = path_relative_to_config(file)

# Optimization to quickly decide if the given file is hidden (on the top
# level) and can not be matched by any pattern.
# level) and cannot be matched by any pattern.
is_hidden = relative_file_path.start_with?('.') &&
!relative_file_path.start_with?('..')
return false if is_hidden && !possibly_include_hidden?
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/bundler/insecure_protocol_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module Bundler
#
# However, it don't replace all `sources` of `http://` with `https://`.
# For example, when specifying an internal gem server using HTTP on the
# intranet, a use case where HTTPS can not be specified was considered.
# Consider using HTTP only if you can not use HTTPS.
# intranet, a use case where HTTPS cannot be specified was considered.
# Consider using HTTP only if you cannot use HTTPS.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/each_with_object_argument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Lint
# num = 0
# sum = numbers.each_with_object(num) { |e, a| a += e }
class EachWithObjectArgument < Cop
MSG = 'The argument to each_with_object can not be immutable.'
MSG = 'The argument to each_with_object cannot be immutable.'

def_node_matcher :each_with_object?, <<~PATTERN
({send csend} _ :each_with_object $_)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/mixin/alignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def check_alignment(items, base_column = nil)
# If this offense is within a line range that is already being
# realigned by autocorrect, we report the offense without
# autocorrecting it. Two rewrites in the same area by the same
# cop can not be handled. The next iteration will find the
# cop cannot be handled. The next iteration will find the
# offense again and correct it.
add_offense(nil, location: expr)
else
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/infinite_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def while_or_until(node)
# `loop do` without further modification. The reason is that a
# variable that's introduced inside a while/until loop is in scope
# outside of that loop too, but a variable that's assigned for the
# first time inside a block can not be accessed after the block. In
# first time inside a block cannot be accessed after the block. In
# those more complicated cases we don't report an offense.
return if @variables.any? do |var|
assigned_inside_loop?(var, range) &&
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/node_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def term(index, range)
def compile_seq_head
return unless seq_head?

fail_due_to 'sequences can not start with <' \
fail_due_to 'sequences cannot start with <' \
if @terms[0].respond_to? :call

with_seq_head_context(@terms[0])
Expand Down
12 changes: 6 additions & 6 deletions lib/rubocop/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,18 @@ def validate_cop_options
# rubocop:disable Metrics/AbcSize
def validate_compatibility # rubocop:disable Metrics/MethodLength
if only_includes_redundant_disable?
raise OptionArgumentError, 'Lint/RedundantCopDisableDirective can ' \
'not be used with --only.'
raise OptionArgumentError, 'Lint/RedundantCopDisableDirective cannot ' \
'be used with --only.'
end
if except_syntax?
raise OptionArgumentError, 'Syntax checking can not be turned off.'
raise OptionArgumentError, 'Syntax checking cannot be turned off.'
end
unless boolean_or_empty_cache?
raise OptionArgumentError, '-C/--cache argument must be true or false'
end

if display_only_fail_level_offenses_with_autocorrect?
raise OptionArgumentError, '--autocorrect can not be used with ' \
raise OptionArgumentError, '--autocorrect cannot be used with ' \
'--display-only-fail-level-offenses'
end
validate_auto_gen_config
Expand Down Expand Up @@ -329,8 +329,8 @@ def validate_parallel_with_combo_option
auto_gen_config: '-P/--parallel uses caching to speed up execution, ' \
'while --auto-gen-config needs a non-cached run, ' \
'so they cannot be combined.',
fail_fast: '-P/--parallel can not be combined with -F/--fail-fast.',
auto_correct: '-P/--parallel can not be combined with --auto-correct.'
fail_fast: '-P/--parallel cannot be combined with -F/--fail-fast.',
auto_correct: '-P/--parallel cannot be combined with --auto-correct.'
}

combos.each do |key, msg|
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def cached_run?
@config_store.for(Dir.pwd).for_all_cops['UseCache']) &&
# When running --auto-gen-config, there's some processing done in the
# cops related to calculating the Max parameters for Metrics cops. We
# need to do that processing and can not use caching.
# need to do that processing and cannot use caching.
!@options[:auto_gen_config] &&
# We can't cache results from code which is piped in to stdin
!@options[:stdin]
Expand Down
2 changes: 1 addition & 1 deletion manual/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ and `fatal`.

There is one exception from the general rule above and that is `Lint/Syntax`, a
special cop that checks for syntax errors before the other cops are invoked. It
can not be disabled and its severity (`fatal`) can not be changed in
cannot be disabled and its severity (`fatal`) cannot be changed in
configuration.

```yaml
Expand Down
4 changes: 2 additions & 2 deletions manual/cops_bundler.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ most use cases HTTPS will be fine.

However, it don't replace all `sources` of `http://` with `https://`.
For example, when specifying an internal gem server using HTTP on the
intranet, a use case where HTTPS can not be specified was considered.
Consider using HTTP only if you can not use HTTPS.
intranet, a use case where HTTPS cannot be specified was considered.
Consider using HTTP only if you cannot use HTTPS.

### Examples

Expand Down
2 changes: 1 addition & 1 deletion relnotes/v0.28.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

* [#801](https://github.com/rubocop-hq/rubocop/issues/801): New style `context_dependent` for `Style/BracesAroundHashParameters` looks at preceding parameter to determine if braces should be used for final parameter. ([@jonas054][])
* [#1427](https://github.com/rubocop-hq/rubocop/issues/1427): Excluding directories on the top level is now done earlier, so that these file trees are not searched, thus saving time when inspecting projects with many excluded files. ([@jonas054][])
* [#1325](https://github.com/rubocop-hq/rubocop/issues/1325): When running with `--auto-correct`, only offenses *that can not be corrected* will result in a non-zero exit code. ([@jonas054][])
* [#1325](https://github.com/rubocop-hq/rubocop/issues/1325): When running with `--auto-correct`, only offenses *that cannot be corrected* will result in a non-zero exit code. ([@jonas054][])
* [#1445](https://github.com/rubocop-hq/rubocop/issues/1445): Allow sprockets directive comments (starting with `#=`) in `Style/LeadingCommentSpace`. ([@bbatsov][])

### Bugs fixed
Expand Down
2 changes: 1 addition & 1 deletion relnotes/v0.31.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* [#1832](https://github.com/rubocop-hq/rubocop/pull/1832): Fix bug in `UnusedMethodArgument` that would cause them to report having been auto-corrected when they were not. ([@jonas054][])
* [#1834](https://github.com/rubocop-hq/rubocop/issues/1834): Support only boolean values for `AutoCorrect` configuration parameter, and remove warning for unknown parameter. ([@jonas054][])
* [#1843](https://github.com/rubocop-hq/rubocop/issues/1843): Fix crash in `TrailingBlankLines` when a file ends with a block comment without final newline. ([@jonas054][])
* [#1849](https://github.com/rubocop-hq/rubocop/issues/1849): Fix bug where you can not have nested arrays in the Rake task configuration. ([@rrosenblum][])
* [#1849](https://github.com/rubocop-hq/rubocop/issues/1849): Fix bug where you cannot have nested arrays in the Rake task configuration. ([@rrosenblum][])
* Fix bug in `MultilineTernaryOperator` where it will not register an offense when only the false branch is on a separate line. ([@rrosenblum][])
* Fix crash in `MultilineBlockLayout` when using new lambda literal syntax without parentheses. ([@hbd225][])
* [#1859](https://github.com/rubocop-hq/rubocop/pull/1859): Fix bugs in `IfUnlessModifier` concerning comments and empty lines. ([@jonas054][])
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
expect(cli.run(['--only', 'RedundantCopDisableDirective'])).to eq(2)
expect($stderr.string)
.to include(
'Lint/RedundantCopDisableDirective can not be used with --only.'
'Lint/RedundantCopDisableDirective cannot be used with --only.'
)
end
end
Expand Down Expand Up @@ -394,7 +394,7 @@ class SomeCop < Cop
create_file('example.rb', 'x ')
expect(cli.run(['--except', name])).to eq(2)
expect($stderr.string)
.to include('Syntax checking can not be turned off.')
.to include('Syntax checking cannot be turned off.')
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/rubocop/cop/lint/each_with_object_argument_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
it 'registers an offense for fixnum argument' do
expect_offense(<<~RUBY)
collection.each_with_object(0) { |e, a| a + e }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object can not be immutable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object cannot be immutable.
RUBY
end

it 'registers an offense for float argument' do
expect_offense(<<~RUBY)
collection.each_with_object(0.1) { |e, a| a + e }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object can not be immutable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object cannot be immutable.
RUBY
end

it 'registers an offense for bignum argument' do
expect_offense(<<~RUBY)
c.each_with_object(100000000000000000000) { |e, o| o + e }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object can not be immutable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object cannot be immutable.
RUBY
end

Expand All @@ -41,7 +41,7 @@
it 'registers an offense for fixnum argument' do
expect_offense(<<~RUBY)
collection&.each_with_object(0) { |e, a| a + e }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object can not be immutable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The argument to each_with_object cannot be immutable.
RUBY
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def abs(path)

context 'combined with --auto-correct' do
it 'fails with an error message' do
msg = '-P/--parallel can not be combined with --auto-correct.'
msg = '-P/--parallel cannot be combined with --auto-correct.'
expect { options.parse %w[--parallel --auto-correct] }
.to raise_error(RuboCop::OptionArgumentError, msg)
end
Expand All @@ -212,7 +212,7 @@ def abs(path)

context 'combined with --fail-fast' do
it 'fails with an error message' do
msg = '-P/--parallel can not be combined with -F/--fail-fast.'
msg = '-P/--parallel cannot be combined with -F/--fail-fast.'
expect { options.parse %w[--parallel --fail-fast] }
.to raise_error(RuboCop::OptionArgumentError, msg)
end
Expand Down

0 comments on commit dff7052

Please sign in to comment.