Skip to content

Commit 1be017b

Browse files
Merge pull request #324 from appium/rubocop
Rubocop
2 parents 893165d + fb534a0 commit 1be017b

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

.rubocop.yml

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Metrics/LineLength:
33
Max: 125
44
Metrics/MethodLength:
55
Max: 30
6+
Metrics/ClassLength:
7+
Enabled: false
68
Metrics/CyclomaticComplexity:
79
Enabled: false
810
Metrics/PerceivedComplexity:
@@ -20,3 +22,7 @@ Style/ConstantName:
2022
# blocked on https://github.com/appium/ruby_lib/issues/312
2123
Style/GlobalVars:
2224
Enabled: false
25+
Style/AccessorMethodName:
26+
Enabled: false
27+
Style/DoubleNegation:
28+
Enabled: false

lib/appium_lib/android/helper.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ module Android
33
# @private
44
# http://nokogiri.org/Nokogiri/XML/SAX.html
55
class AndroidElements < Nokogiri::XML::SAX::Document
6-
attr_reader :result, :keys, :instance
7-
8-
def filter
9-
@filter
10-
end
6+
attr_reader :result, :keys, :instance, :filter
117

128
# convert to string to support symbols
139
def filter=(value)

lib/appium_lib/common/helper.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ def resolve_id(id)
158158
end
159159

160160
class HTMLElements < Nokogiri::XML::SAX::Document
161-
def filter
162-
@filter
163-
end
161+
attr_reader :filter
164162

165163
# convert to string to support symbols
166164
def filter=(value)

lib/appium_lib/common/patch.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ def raw_execute(command, opts = {}, command_hash = nil)
121121
end
122122

123123
# Print Appium's origValue error messages.
124-
class Selenium::WebDriver::Remote::Response # rubocop:disable Style/ClassAndModuleChildren
124+
# rubocop:disable Style/ClassAndModuleChildren
125+
# rubocop:disable Style/AndOr
126+
class Selenium::WebDriver::Remote::Response
125127
# @private
126128
def error_message
127129
val = value

lib/appium_lib/device/touch_actions.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def release(opts = nil)
7979
# @option opts [integer] :fingers how many fingers to tap with (Default 1)
8080
def tap(opts)
8181
opts[:count] = opts.delete(:fingers) if opts[:fingers]
82-
opts_with_defaults = { count: 1 }.merge opts
82+
opts[:count] ||= 1
8383
args = args_with_ele_ref opts
8484
chain_method(:tap, args)
8585
end

lib/appium_lib/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def driver_quit
465465
# @return [Selenium::WebDriver] the new global driver
466466
def start_driver
467467
@client ||= Selenium::WebDriver::Remote::Http::Default.new
468-
@client.timeout = 999999
468+
@client.timeout = 999_999
469469

470470
begin
471471
driver_quit

lib/appium_lib/rails/duplicable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# rubocop:disable Style/BlockComments
2-
2+
# rubocop:disable Lint/HandleExceptions
33
# https://github.com/rails/rails/blob/e120d21211f9644e9b832e51ba7aa6c45448b782/activesupport/lib/active_support/core_ext/object/duplicable.rb
44
=begin
55
Copyright (c) 2005-2011 David Heinemeier Hansson

0 commit comments

Comments
 (0)