Skip to content

Commit

Permalink
rubocop: run safe linters
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarthus committed Mar 29, 2023
1 parent ae0bac8 commit 85ebd2c
Show file tree
Hide file tree
Showing 95 changed files with 40 additions and 272 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AllCops:
- 'gemfiles/arel_gems.gemfile'
- 'gemfiles/default.gemfile'
- 'vendor/bundle/**/*'

SuggestExtensions: false

Bundler/OrderedGems:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# NOTE: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
Expand Down
9 changes: 2 additions & 7 deletions lib/arel/enhance/node.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module Arel
module Enhance
class Node
attr_reader :local_path
attr_reader :object
attr_reader :parent
attr_reader :root_node
attr_reader :local_path, :object, :parent, :root_node

def initialize(object)
@object = object
Expand Down Expand Up @@ -126,9 +123,7 @@ def context

protected

attr_writer :local_path
attr_writer :parent
attr_writer :root_node
attr_writer :local_path, :parent, :root_node

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
Expand Down
3 changes: 1 addition & 2 deletions lib/arel/enhance/path_node.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module Arel
module Enhance
class PathNode
attr_reader :method
attr_reader :value
attr_reader :method, :value

def initialize(method, value)
@method = method
Expand Down
2 changes: 0 additions & 2 deletions lib/arel/extensions/active_model_attribute_with_cast_value.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Visitors
Expand All @@ -19,4 +18,3 @@ def visit_ActiveModel_Attribute_WithCastValue(_o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/active_record_relation_query_attribute.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Visitors
Expand All @@ -19,4 +18,3 @@ def visit_ActiveRecord_Relation_QueryAttribute(_o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/all.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -20,4 +19,3 @@ def visit_Arel_Nodes_All(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/any.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -20,4 +19,3 @@ def visit_Arel_Nodes_Any(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/array.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -19,4 +18,3 @@ def visit_Arel_Nodes_Array(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/array_subselect.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -20,4 +19,3 @@ def visit_Arel_Nodes_ArraySubselect(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/assignment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName
module Arel
module Visitors
class ToSql
Expand All @@ -19,4 +18,3 @@ def visit_Arel_Nodes_Assignment(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
5 changes: 1 addition & 4 deletions lib/arel/extensions/at_time_zone.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
# https://www.postgresql.org/docs/9.2/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT
class AtTimeZone < Arel::Nodes::Node
attr_reader :timezone
attr_reader :expr
attr_reader :timezone, :expr

def initialize(expr, timezone)
@expr = expr
Expand Down Expand Up @@ -34,4 +32,3 @@ def visit_Arel_Nodes_AtTimeZone(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/attributes_attribute.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Attributes
Expand Down Expand Up @@ -44,4 +43,3 @@ def visit_Arel_Attributes_Attribute(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/between_symmetric.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -20,4 +19,3 @@ def visit_Arel_Nodes_BetweenSymmetric(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/bind_param.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Visitors
Expand All @@ -12,4 +11,3 @@ def visit_Arel_Nodes_BindParam(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/bit_string.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -17,4 +16,3 @@ def visit_Arel_Nodes_BitString(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/case.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Visitors
Expand All @@ -14,4 +13,3 @@ def visit_Arel_Nodes_Case(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/coalesce.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -20,4 +19,3 @@ def visit_Arel_Nodes_Coalesce(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
7 changes: 1 addition & 6 deletions lib/arel/extensions/conflict.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
# https://www.postgresql.org/docs/9.5/sql-insert.html
class Conflict < Arel::Nodes::Node
attr_accessor :action
attr_accessor :infer
attr_accessor :values
attr_accessor :wheres
attr_accessor :action, :infer, :values, :wheres
end
end

Expand Down Expand Up @@ -53,4 +49,3 @@ def visit_Arel_Nodes_Conflict(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/contains.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
if Gem.loaded_specs.key?('postgres_ext')
Expand Down Expand Up @@ -29,4 +28,3 @@ def initialize(left, right)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/cross_join.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -18,4 +17,3 @@ def visit_Arel_Nodes_CrossJoin(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_catalog.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -21,4 +20,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_date.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -21,4 +20,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_of_expression.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -19,4 +18,3 @@ def visit_Arel_Nodes_CurrentOfExpression(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_role.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -21,4 +20,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -21,4 +20,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_time.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -19,4 +18,3 @@ def visit_Arel_Nodes_CurrentTime(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_timestamp.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -19,4 +18,3 @@ def visit_Arel_Nodes_CurrentTimestamp(o, collector)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/current_user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -21,4 +20,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/dealocate.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Visitors
Expand Down Expand Up @@ -28,4 +27,3 @@ def initialize(name)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/default_values.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
Expand All @@ -22,4 +21,3 @@ class Dot
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
2 changes: 0 additions & 2 deletions lib/arel/extensions/delete_manager.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
class DeleteManager < Arel::TreeManager
Expand All @@ -22,4 +21,3 @@ def visit_Arel_DeleteManager(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
7 changes: 1 addition & 6 deletions lib/arel/extensions/delete_statement.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
module Nodes
# https://www.postgresql.org/docs/10/sql-delete.html
class DeleteStatement
module DeleteStatementExtension
attr_accessor :using
attr_accessor :with
attr_accessor :returning
attr_accessor :orders
attr_accessor :using, :with, :returning, :orders

def initialize(relation = nil, wheres = [])
super
Expand Down Expand Up @@ -75,4 +71,3 @@ def visit_Arel_Nodes_DeleteStatement(o)
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName
Loading

0 comments on commit 85ebd2c

Please sign in to comment.