Skip to content

Commit

Permalink
Suppress InternalAffairs/CopDescription offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed May 13, 2022
1 parent f175777 commit 6738d9a
Show file tree
Hide file tree
Showing 40 changed files with 41 additions and 50 deletions.
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/ancestors_include.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `ancestors.include?` and
# change them to use `<=` instead.
# Identifies usages of `ancestors.include?` and change them to use `<=` instead.
#
# @safety
# This cop is unsafe because it can't tell whether the receiver is a class or an object.
Expand Down
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where slicing arrays with semi-infinite ranges
# Identifies places where slicing arrays with semi-infinite ranges
# can be replaced by `Array#take` and `Array#drop`.
# This cop was created due to a mistake in microbenchmark and hence is disabled by default.
# Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717
Expand Down
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where numeric argument to BigDecimal should be
# Identifies places where numeric argument to BigDecimal should be
# converted to string. Initializing from String is faster
# than from Numeric for BigDecimal.
#
Expand Down
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a `block_given?` where explicit check
# Identifies unnecessary use of a `block_given?` where explicit check
# of block argument would suffice.
#
# @example
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/caller.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `caller[n]`
# can be replaced by `caller(n..n).first`.
# Identifies places where `caller[n]` can be replaced by `caller(n..n).first`.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/casecmp.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where a case-insensitive string comparison
# Identifies places where a case-insensitive string comparison
# can better be implemented using `casecmp`.
#
# @safety
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/chain_array_allocation.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `array.compact.flatten.map { |x| x.downcase }`.
# Identifies usages of `array.compact.flatten.map { |x| x.downcase }`.
# Each of these methods (`compact`, `flatten`, `map`) will generate a new intermediate array
# that is promptly thrown away. Instead it is faster to mutate when we know it's safe.
#
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/performance/collection_literal_in_loop.rb
Expand Up @@ -5,8 +5,8 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where Array and Hash literals are used
# within loops. It is better to extract them into a local variable or constant
# Identifies places where Array and Hash literals are used within loops.
# It is better to extract them into a local variable or constant
# to avoid unnecessary allocations on each iteration.
#
# You can set the minimum number of elements to consider
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/compare_with_block.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| a.foo <=> b.foo }`
# Identifies places where `sort { |a, b| a.foo <=> b.foo }`
# can be replaced by `sort_by(&:foo)`.
# This cop also checks `max` and `min` methods.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/concurrent_monotonic_time.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `Concurrent.monotonic_time`
# Identifies places where `Concurrent.monotonic_time`
# can be replaced by `Process.clock_gettime(Process::CLOCK_MONOTONIC)`.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/constant_regexp.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop finds regular expressions with dynamic components that are all constants.
# Finds regular expressions with dynamic components that are all constants.
#
# Ruby allocates a new Regexp object every time it executes a code containing such
# a regular expression. It is more efficient to extract it into a constant,
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/count.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `count` on an `Enumerable` that
# Identifies usages of `count` on an `Enumerable` that
# follow calls to `select`, `find_all`, `filter` or `reject`. Querying logic can instead be
# passed to the `count` call.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/detect.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `first`, `last`, `[0]` or `[-1]`
# Identifies usages of `first`, `last`, `[0]` or `[-1]`
# chained to `select`, `find_all` or `filter` and change them to use
# `detect` instead.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/double_start_end_with.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for double `#start_with?` or `#end_with?` calls
# Checks for double `#start_with?` or `#end_with?` calls
# separated by `||`. In some cases such calls can be replaced
# with an single `#start_with?`/`#end_with?` call.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/end_with.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where `String#end_with?` would suffice.
# Identifies unnecessary use of a regex where `String#end_with?` would suffice.
#
# This cop has `SafeMultiline` configuration option that `true` by default because
# `end$` is unsafe as it will behave incompatible with `end_with?`
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/flat_map.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `map { ... }.flatten` and
# Identifies usages of `map { ... }.flatten` and
# change them to use `flat_map { ... }` instead.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/inefficient_hash_search.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for inefficient searching of keys and values within
# Checks for inefficient searching of keys and values within
# hashes.
#
# `Hash#keys.include?` is less efficient than `Hash#key?` because
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/io_readlines.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where inefficient `readlines` method
# Identifies places where inefficient `readlines` method
# can be replaced by `each_line` to avoid fully loading file content into memory.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/method_object_as_block.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where methods are converted to blocks, with the
# Identifies places where methods are converted to blocks, with the
# use of `&method`, and passed as arguments to method calls.
# It is faster to replace those with explicit blocks, calling those methods inside.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/open_struct.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for `OpenStruct.new` calls.
# Checks for `OpenStruct.new` calls.
# Instantiation of an `OpenStruct` invalidates
# Ruby global method cache as it causes dynamic method
# definition during program runtime.
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/range_include.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies uses of `Range#include?` and `Range#member?`, which iterates over each
# Identifies uses of `Range#include?` and `Range#member?`, which iterates over each
# item in a `Range` to see if a specified item is there. In contrast,
# `Range#cover?` simply compares the target item with the beginning and
# end points of the `Range`. In a great majority of cases, this is what
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/redundant_block_call.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies the use of a `&block` parameter and `block.call`
# Identifies the use of a `&block` parameter and `block.call`
# where `yield` would do just as well.
#
# @example
Expand Down
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
# Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
# and `Enumerable#none?` are compared with `===` or similar methods in block.
#
# By default, `Object#===` behaves the same as `Object#==`, but this
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/redundant_match.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies the use of `Regexp#match` or `String#match`, which
# Identifies the use of `Regexp#match` or `String#match`, which
# returns `#<MatchData>`/`nil`. The return value of `=~` is an integral
# index/`nil` and is more performant.
#
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/redundant_merge.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `Hash#merge!` can be replaced by
# `Hash#[]=`.
# Identifies places where `Hash#merge!` can be replaced by `Hash#[]=`.
# You can set the maximum number of key-value pairs to consider
# an offense with `MaxKeyValuePairs`.
#
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/redundant_sort_block.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| a <=> b }`
# can be replaced with `sort`.
# Identifies places where `sort { |a, b| a <=> b }` can be replaced with `sort`.
#
# @example
# # bad
Expand Down
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `split` argument can be replaced from
# Identifies places where `split` argument can be replaced from
# a deterministic regexp to a string.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/redundant_string_chars.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for redundant `String#chars`.
# Checks for redundant `String#chars`.
#
# @example
# # bad
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/reverse_each.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `reverse.each` and
# change them to use `reverse_each` instead.
# Identifies usages of `reverse.each` and change them to use `reverse_each` instead.
#
# If the return value is used, it will not be detected because the result will be different.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/reverse_first.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `reverse.first(n)` and `reverse.first`
# Identifies places where `reverse.first(n)` and `reverse.first`
# can be replaced by `last(n).reverse` and `last`.
#
# @example
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/size.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `count` on an
# `Array` and `Hash` and change them to `size`.
# Identifies usages of `count` on an `Array` and `Hash` and change them to `size`.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/sort_reverse.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| b <=> a }`
# Identifies places where `sort { |a, b| b <=> a }`
# can be replaced by a faster `sort.reverse`.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/squeeze.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `gsub(/a+/, 'a')` and `gsub!(/a+/, 'a')`
# Identifies places where `gsub(/a+/, 'a')` and `gsub!(/a+/, 'a')`
# can be replaced by `squeeze('a')` and `squeeze!('a')`.
#
# The `squeeze('a')` method is faster than `gsub(/a+/, 'a')`.
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/start_with.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where `String#start_with?` would suffice.
# Identifies unnecessary use of a regex where `String#start_with?` would suffice.
#
# This cop has `SafeMultiline` configuration option that `true` by default because
# `^start` is unsafe as it will behave incompatible with `start_with?`
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/string_identifier_argument.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where string identifier argument can be replaced
# Identifies places where string identifier argument can be replaced
# by symbol identifier argument.
# It prevents the redundancy of the internal string-to-symbol conversion.
#
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/string_include.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where
# `String#include?` would suffice.
# Identifies unnecessary use of a regex where `String#include?` would suffice.
#
# @safety
# This cop's offenses are not safe to auto-correct if a receiver is nil.
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/string_replacement.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `gsub` can be replaced by
# `tr` or `delete`.
# Identifies places where `gsub` can be replaced by `tr` or `delete`.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/sum.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where custom code finding the sum of elements
# Identifies places where custom code finding the sum of elements
# in some Enumerable object can be replaced by `Enumerable#sum` method.
#
# @safety
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/times_map.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for .times.map calls.
# Checks for .times.map calls.
# In most cases such calls can be replaced
# with an explicit array creation.
#
Expand Down
3 changes: 1 addition & 2 deletions lib/rubocop/cop/performance/uri_default_parser.rb
Expand Up @@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `URI::Parser.new`
# can be replaced by `URI::DEFAULT_PARSER`.
# Identifies places where `URI::Parser.new` can be replaced by `URI::DEFAULT_PARSER`.
#
# @example
# # bad
Expand Down

0 comments on commit 6738d9a

Please sign in to comment.