Skip to content

Commit e5b727a

Browse files
authored
Merge pull request #729 from pirj/pass-range-as-a-positional-argument-in-range_help-range_with_surrounding_space
Pass range as a positional arg
2 parents 4032c62 + 757e9e4 commit e5b727a

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#729](https://github.com/rubocop/rubocop-rails/pull/729): Change the minimum required `rubocop` dependency version to 1.31.0. ([@pirj][])

lib/rubocop/cop/rails/add_column_index.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def on_send(node)
5454

5555
def index_range(pair_node)
5656
range_with_surrounding_comma(
57-
range_with_surrounding_space(range: pair_node.loc.expression, side: :left),
57+
range_with_surrounding_space(pair_node.loc.expression, side: :left),
5858
:left
5959
)
6060
end

lib/rubocop/cop/rails/dot_separated_keys.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def on_send(node)
3737

3838
add_offense(scope_node) do |corrector|
3939
# Eat the comma on the left.
40-
range = range_with_surrounding_space(range: scope_node.source_range, side: :left)
40+
range = range_with_surrounding_space(scope_node.source_range, side: :left)
4141
range = range_with_surrounding_comma(range, :left)
4242
corrector.remove(range)
4343

lib/rubocop/cop/rails/redundant_foreign_key.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def on_send(node)
4141
association_with_foreign_key(node) do |type, name, options, foreign_key_pair, foreign_key|
4242
if redundant?(node, type, name, options, foreign_key)
4343
add_offense(foreign_key_pair.loc.expression) do |corrector|
44-
range = range_with_surrounding_space(range: foreign_key_pair.source_range, side: :left)
44+
range = range_with_surrounding_space(foreign_key_pair.source_range, side: :left)
4545
range = range_with_surrounding_comma(range, :left)
4646

4747
corrector.remove(range)

lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def remove_keys_from_validation(corrector, node, keys)
217217
keys.each do |key|
218218
key_node = node.arguments.find { |arg| arg.value == key }
219219
key_range = range_with_surrounding_space(
220-
range: range_with_surrounding_comma(key_node.source_range, :right),
220+
range_with_surrounding_comma(key_node.source_range, :right),
221221
side: :right
222222
)
223223
corrector.remove(key_range)
@@ -226,7 +226,7 @@ def remove_keys_from_validation(corrector, node, keys)
226226

227227
def remove_presence_option(corrector, presence)
228228
range = range_with_surrounding_comma(
229-
range_with_surrounding_space(range: presence.source_range, side: :left),
229+
range_with_surrounding_space(presence.source_range, side: :left),
230230
:left
231231
)
232232
corrector.remove(range)

rubocop-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ Gem::Specification.new do |s|
3636
# Rack::Utils::SYMBOL_TO_STATUS_CODE, which is used by HttpStatus cop, was
3737
# introduced in rack 1.1
3838
s.add_runtime_dependency 'rack', '>= 1.1'
39-
s.add_runtime_dependency 'rubocop', '>= 1.7.0', '< 2.0'
39+
s.add_runtime_dependency 'rubocop', '>= 1.31.0', '< 2.0'
4040
end

0 commit comments

Comments
 (0)