diff options
Diffstat (limited to 'Library/Homebrew/rubocops')
| -rw-r--r-- | Library/Homebrew/rubocops/bottle_block_cop.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/checksum_cop.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/class_cop.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/components_order_cop.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/extend/formula_cop.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/formula_desc_cop.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/urls_cop.rb | 2 |
7 files changed, 2 insertions, 14 deletions
diff --git a/Library/Homebrew/rubocops/bottle_block_cop.rb b/Library/Homebrew/rubocops/bottle_block_cop.rb index 77759e427..3cfde01ad 100644 --- a/Library/Homebrew/rubocops/bottle_block_cop.rb +++ b/Library/Homebrew/rubocops/bottle_block_cop.rb @@ -16,8 +16,6 @@ module RuboCop problem "Use rebuild instead of revision in bottle block" if method_called_in_block?(bottle, :revision) end - private - def autocorrect(node) lambda do |corrector| correction = node.source.sub("revision", "rebuild") diff --git a/Library/Homebrew/rubocops/checksum_cop.rb b/Library/Homebrew/rubocops/checksum_cop.rb index 23a787809..4dd8ad91c 100644 --- a/Library/Homebrew/rubocops/checksum_cop.rb +++ b/Library/Homebrew/rubocops/checksum_cop.rb @@ -50,8 +50,6 @@ module RuboCop end end - private - def autocorrect(node) lambda do |corrector| correction = node.source.downcase diff --git a/Library/Homebrew/rubocops/class_cop.rb b/Library/Homebrew/rubocops/class_cop.rb index dad81abfc..6f1ffc144 100644 --- a/Library/Homebrew/rubocops/class_cop.rb +++ b/Library/Homebrew/rubocops/class_cop.rb @@ -16,8 +16,6 @@ module RuboCop problem "#{parent_class} is deprecated, use Formula instead" end - private - def autocorrect(node) lambda do |corrector| corrector.replace(node.source_range, "Formula") diff --git a/Library/Homebrew/rubocops/components_order_cop.rb b/Library/Homebrew/rubocops/components_order_cop.rb index 3bf2ede16..a1a576177 100644 --- a/Library/Homebrew/rubocops/components_order_cop.rb +++ b/Library/Homebrew/rubocops/components_order_cop.rb @@ -62,8 +62,6 @@ module RuboCop end end - private - # Method to format message for reporting component precedence violations def component_problem(c1, c2) problem "`#{format_component(c1)}` (line #{line_number(c1)}) should be put before `#{format_component(c2)}` (line #{line_number(c2)})" @@ -99,7 +97,7 @@ module RuboCop line_breaks = (order_idx > 8) ? "\n\n" : "\n" corrector.insert_before(node2.source_range, node1.source + line_breaks + indentation) end - corrector.remove(range_with_surrounding_space(node1.source_range, :left)) + corrector.remove(range_with_surrounding_space(range: node1.source_range, side: :left)) end # Returns precedence index and component's index to properly reorder and group during autocorrect diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb index de369a0aa..e53c02a44 100644 --- a/Library/Homebrew/rubocops/extend/formula_cop.rb +++ b/Library/Homebrew/rubocops/extend/formula_cop.rb @@ -425,7 +425,7 @@ module RuboCop # Returns the block length of the block node def block_size(block) - block_length(block) + block.loc.end.line - block.loc.begin.line end # Source buffer is required as an argument to report style violations diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb index 8a35e7d24..240a28072 100644 --- a/Library/Homebrew/rubocops/formula_desc_cop.rb +++ b/Library/Homebrew/rubocops/formula_desc_cop.rb @@ -88,8 +88,6 @@ module RuboCop problem "Description shouldn't end with a full stop" end - private - def autocorrect(node) lambda do |corrector| correction = node.source diff --git a/Library/Homebrew/rubocops/urls_cop.rb b/Library/Homebrew/rubocops/urls_cop.rb index 414f633c9..4ef801689 100644 --- a/Library/Homebrew/rubocops/urls_cop.rb +++ b/Library/Homebrew/rubocops/urls_cop.rb @@ -206,8 +206,6 @@ module RuboCop end end - private - def autocorrect(node) lambda do |corrector| url_string_node = parameters(node).first |
