Skip to content

Commit 3ba5482

Browse files
authored
fix: Add ignore inline comments and needed signature files (#669)
This PR removes several steep errors and adds ignore inline comments when needed
1 parent a8052bc commit 3ba5482

13 files changed

Lines changed: 25 additions & 18 deletions

File tree

lib/appium_lib_core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def self.symbolize_keys(hash, nested: false, enable_deprecation_msg: true)
3636
# the methods which expect the symbol first.
3737
raise ::Appium::Core::Error::ArgumentError, 'symbolize_keys requires a hash' unless hash.is_a? Hash
3838

39-
hash.each_with_object({}) do |pair, acc|
39+
hash.each_with_object({}) do |pair, acc| # steep:ignore
4040
key = begin
4141
if enable_deprecation_msg && !(pair[0].is_a? Symbol)
4242
::Appium::Logger.warn("[Deprecation] The key '#{pair[0]}' must be a symbol while currently it " \

lib/appium_lib_core/common/base/bridge.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def create_session(capabilities)
112112
@available_commands = ::Appium::Core::Commands::COMMANDS.dup
113113

114114
always_match = add_appium_prefix(capabilities)
115-
response = execute(:new_session, {}, { capabilities: { alwaysMatch: always_match, firstMatch: [{}] } })
115+
response = execute(:new_session, {}, { capabilities: { alwaysMatch: always_match, firstMatch: [{}] } }) # steep:ignore
116116

117117
@session_id = response['sessionId']
118118
raise ::Selenium::WebDriver::Error::WebDriverError, 'no sessionId in returned payload' unless @session_id
@@ -273,7 +273,7 @@ def set_location(lat, lon, alt = 0.0, speed: nil, satellites: nil)
273273
# No implementation for W3C webdriver module
274274
def available_log_types
275275
types = execute :get_available_log_types
276-
Array(types).map(&:to_sym)
276+
Array(types).map(&:to_sym) # steep:ignore
277277
end
278278

279279
# For Appium
@@ -297,7 +297,7 @@ def log_event(vendor, event)
297297

298298
# For Appium
299299
def log_events(type = nil)
300-
args = {}
300+
args = {} # steep:ignore
301301
args['type'] = type unless type.nil?
302302

303303
execute :get_log_events, {}, args

lib/appium_lib_core/common/command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module Commands
208208
chrome_send_command: [:post, 'session/:session_id/goog/cdp/execute']
209209
}.freeze
210210

211-
COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).freeze
211+
COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).freeze # steep:ignore
212212
end # module Commands
213213
end # module Core
214214
end # module Appium

lib/appium_lib_core/common/device/app_management.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Base
1818
module Device
1919
module AppManagement
2020
def app_strings(language = nil)
21-
opts = language ? { language: language } : {}
21+
opts = language ? { language: language } : {} # steep:ignore
2222
execute_script 'mobile:getAppStrings', opts
2323
end
2424

@@ -27,7 +27,7 @@ def background_app(duration = 0)
2727
raise NotImplementedError
2828
end
2929

30-
def install_app(path, options = {})
30+
def install_app(path, options = {}) # steep:ignore
3131
args = { appPath: path }
3232
args[:options] = options unless options&.empty?
3333

lib/appium_lib_core/common/device/device.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def shake
2222
end
2323

2424
def device_time(format = nil)
25-
arg = {}
25+
arg = {} # steep:ignore
2626
arg[:format] = format unless format.nil?
2727

2828
execute_script 'mobile:getDeviceTime', arg

lib/appium_lib_core/common/device/device_lock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Base
1818
module Device
1919
module DeviceLock
2020
def lock(duration = nil)
21-
opts = duration ? { seconds: duration } : {}
21+
opts = duration ? { seconds: duration } : {} # steep:ignore
2222
execute_script 'mobile:lock', opts
2323
end
2424

lib/appium_lib_core/common/device/image_comparison.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def match_images_features(first_image:,
6868
raise ::Appium::Core::Error::ArgumentError, "match_func should be #{MATCH_FEATURES[:match_func]}" unless MATCH_FEATURES[:match_func].member?(match_func.to_s)
6969
raise ::Appium::Core::Error::ArgumentError, "visualize should be #{MATCH_FEATURES[:visualize]}" unless MATCH_FEATURES[:visualize].member?(visualize)
7070

71-
options = {}
71+
options = {} # steep:ignore
7272
options[:detectorName] = detector_name.to_s.upcase
7373
options[:matchFunc] = match_func.to_s
7474
options[:goodMatchesFactor] = good_matches_factor.to_i unless good_matches_factor.nil?
@@ -108,7 +108,7 @@ def find_image_occurrence(full_image:, partial_image:, visualize: false, thresho
108108
"visualize should be #{MATCH_TEMPLATE[:visualize]}"
109109
end
110110

111-
options = {}
111+
options = {} # steep:ignore
112112
options[:visualize] = visualize
113113
options[:threshold] = threshold unless threshold.nil?
114114
options[:multiple] = multiple unless multiple.nil?
@@ -138,7 +138,7 @@ def get_images_similarity(first_image:, second_image:, visualize: false)
138138
"visualize should be #{GET_SIMILARITY[:visualize]}"
139139
end
140140

141-
options = {}
141+
options = {} # steep:ignore
142142
options[:visualize] = visualize
143143

144144
compare_images(mode: :getSimilarity, first_image: first_image, second_image: second_image, options: options)
@@ -160,7 +160,7 @@ def get_images_similarity(first_image:, second_image:, visualize: false)
160160
def compare_images(mode: :matchFeatures, first_image:, second_image:, options: nil)
161161
raise ::Appium::Core::Error::ArgumentError, "content_type should be #{MODE}" unless MODE.member?(mode)
162162

163-
params = {}
163+
params = {} # steep:ignore
164164
params[:mode] = mode
165165
params[:firstImage] = Base64.strict_encode64 first_image
166166
params[:secondImage] = Base64.strict_encode64 second_image

lib/appium_lib_core/common/device/keyboard.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Base
1818
module Device
1919
module Keyboard
2020
def hide_keyboard(close_key = nil)
21-
option = {}
21+
option = {} # steep:ignore
2222

2323
option[:key] = close_key || 'Done' # default to Done key.
2424

lib/appium_lib_core/common/device/screen_record.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize(remote_path: nil, user: nil, pass: nil, method: 'PUT',
3535
'method should be POST or PUT'
3636
end
3737

38-
option = {}
38+
option = {} # steep:ignore
3939
option[:remotePath] = remote_path
4040
option[:user] = user unless user.nil?
4141
option[:pass] = pass unless pass.nil?
@@ -64,7 +64,7 @@ def stop_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT',
6464
file_field_name: file_field_name, form_fields: form_fields, headers: headers
6565
).upload_option
6666

67-
params = option.empty? ? {} : { options: option }
67+
params = option.empty? ? {} : { options: option } # steep:ignore
6868

6969
execute(:stop_recording_screen, {}, params)
7070
end

lib/appium_lib_core/driver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def get_caps(opts)
603603
o = opts || {}
604604

605605
raw_caps = o[:caps] || o[:capabilities]
606-
caps_hash = raw_caps.is_a?(Hash) ? raw_caps : {}
606+
caps_hash = raw_caps.is_a?(Hash) ? raw_caps : {} # steep:ignore
607607

608608
Core::Base::Capabilities.new(caps_hash)
609609
end
@@ -631,7 +631,7 @@ def set_app_path
631631
app = get_app # for steep reason
632632
return unless app && app.empty?
633633

634-
uri_regex = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
634+
uri_regex = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER # steep:ignore
635635
return if app =~ uri_regex.make_regexp
636636

637637
# steep:ignore

0 commit comments

Comments
 (0)