Skip to content

Commit dc64a72

Browse files
authored
Merge pull request #1820 from troessner/fix-rubocop-offenses
Bump rubocop dependency versions and fix new offenses
2 parents 0ee6db2 + cd70b79 commit dc64a72

File tree

14 files changed

+22
-23
lines changed

14 files changed

+22
-23
lines changed

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ gem 'cucumber', '~> 10.0'
1010
gem 'rake', '~> 13.0'
1111
gem 'rspec', '~> 3.0'
1212
gem 'rspec-benchmark', '~> 0.6.0'
13-
gem 'rubocop', '~> 1.76.1'
14-
gem 'rubocop-performance', '~> 1.25.0'
15-
gem 'rubocop-rspec', '~> 3.6.0'
13+
gem 'rubocop', '~> 1.80.2'
14+
gem 'rubocop-performance', '~> 1.26.0'
15+
gem 'rubocop-rspec', '~> 3.7.0'
1616
gem 'simplecov', '~> 0.22.0'
1717
gem 'yard', '~> 0.9.5'
1818

docs/templates/default/docstring/setup.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ def api_marker
1717
erb(:private) unless ['public', 'private'].include? api_text
1818
end
1919

20-
private
21-
2220
def api_text
2321
api_text = object.has_tag?(:api) && object.tag(:api).text
2422
api_text = 'public' if object.has_tag?(:public)

lib/reek/ast/node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def name
6060
#
6161
# @example
6262
# node.each_node(:send, [:mlhs]) do |call_node| .... end
63-
# node.each_node(:lvar).any? { |it| it.var_name == 'something' }
63+
# node.each_node(:lvar).any? { _1.var_name == 'something' }
6464
# node.each_node([:block]).flat_map do |elem| ... end
6565
#
6666
# Returns an array with all matching nodes.

lib/reek/configuration/configuration_converter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Configuration
99
class ConfigurationConverter
1010
REGEXABLE_ATTRIBUTES = %w(accept reject exclude).freeze
1111
include ConfigurationValidator
12+
1213
attr_reader :configuration
1314

1415
# @param configuration [Hash] e.g.

lib/reek/configuration/configuration_file_finder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module ConfigurationFileFinder
2323

2424
class << self
2525
include ConfigurationValidator
26+
2627
#
2728
# Finds and loads a configuration file from a given path.
2829
#

lib/reek/context/code_context.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Context
1919
class CodeContext
2020
include Enumerable
2121
extend Forwardable
22+
2223
delegate [:name, :type] => :exp
2324

2425
attr_reader :children, :parent, :exp, :statement_counter

lib/reek/smell_detectors/control_parameter_helpers/call_in_condition_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def regular_call_involving_param?(call_node)
7575
# @return [Boolean] if the parameter is used in the given method call
7676
#
7777
def call_involving_param?(call_node)
78-
call_node.each_node(:lvar).any? { |it| it.var_name == parameter }
78+
call_node.each_node(:lvar).any? { _1.var_name == parameter }
7979
end
8080

8181
#

lib/reek/smell_detectors/nested_iterators.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def sniff
6464
# @return [Array<Iterator>]
6565
#
6666
def find_violations
67-
find_candidates.select { |it| it.depth > max_allowed_nesting }
67+
find_candidates.select { _1.depth > max_allowed_nesting }
6868
end
6969

7070
# Finds the set of independent most deeply nested iterators regardless of

lib/reek/smell_detectors/nil_check.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def comparison_call?(call)
7171
end
7272

7373
def involves_nil?(call)
74-
call.participants.any? { |it| it.type == :nil }
74+
call.participants.any? { _1.type == :nil }
7575
end
7676

7777
def comparison_methods
@@ -84,7 +84,7 @@ module NilWhenNodeDetector
8484
module_function
8585

8686
def detect(node)
87-
node.condition_list.any? { |it| it.type == :nil }
87+
node.condition_list.any? { _1.type == :nil }
8888
end
8989
end
9090
end

lib/reek/smell_detectors/too_many_constants.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def self.default_config
3535
# @return [Array<SmellWarning>]
3636
#
3737
def sniff
38-
count = context.local_nodes(:casgn).count { |it| !it.defines_module? }
38+
count = context.local_nodes(:casgn).count { |node| !node.defines_module? }
3939

4040
return [] if count <= max_allowed_constants
4141

0 commit comments

Comments
 (0)