Skip to content

Commit

Permalink
rb - all the style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 16, 2016
1 parent 6ec0748 commit cccc9fe
Show file tree
Hide file tree
Showing 90 changed files with 1,943 additions and 2,140 deletions.
28 changes: 27 additions & 1 deletion rb/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,36 @@ Style/SpaceInsideHashLiteralBraces:
Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent

Lint/AssignmentInCondition:
Style/Alias:
EnforcedStyle: prefer_alias_method

Lint/HandleExceptions:
Enabled: false

Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': '[]'
'%w': '[]'

# Consider documenting all top-level classes and modules
Style/Documentation:
Enabled: false

# Port Integers do not need underscores
Style/NumericLiterals:
Enabled: false

# Bug
Style/FileName:
Exclude:
- 'lib/selenium-webdriver.rb'

# These need to be fixed
Style/MutableConstant:
Exclude:
- 'lib/selenium/webdriver/remote/bridge.rb'
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'

# There shouldn't be any reason to use camel case instead of snake case here
Style/MethodName:
Enabled: false
297 changes: 6 additions & 291 deletions rb/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-06-09 16:27:16 -0700 using RuboCop version 0.37.2.
# on 2016-06-10 10:26:32 -0700 using RuboCop version 0.37.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 10
Lint/HandleExceptions:
Exclude:
- 'lib/selenium/server.rb'
- 'lib/selenium/webdriver/common/platform.rb'
- 'lib/selenium/webdriver/common/socket_poller.rb'
- 'lib/selenium/webdriver/common/wait.rb'
- 'lib/selenium/webdriver/firefox/binary.rb'
- 'lib/selenium/webdriver/remote/bridge.rb'
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
- 'spec/integration/selenium/webdriver/spec_support/test_environment.rb'

# Offense count: 1
Lint/UselessAccessModifier:
Exclude:
- 'lib/selenium/webdriver/support/select.rb'

# Offense count: 3
Lint/UselessAssignment:
Exclude:
- 'lib/selenium/webdriver/firefox/profiles_ini.rb'
- 'spec/integration/selenium/webdriver/touch_spec.rb'
- 'spec/unit/selenium/webdriver/support/color_spec.rb'

# Offense count: 2
Lint/Void:
Exclude:
- 'spec/integration/selenium/webdriver/touch_spec.rb'

# Offense count: 41
Metrics/AbcSize:
Max: 53
Expand All @@ -48,285 +19,29 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 16

# Offense count: 706
# Offense count: 637
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 319
Max: 321

# Offense count: 61
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 37

# Offense count: 3
# Offense count: 7
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 222
Max: 238

# Offense count: 15
Metrics/PerceivedComplexity:
Max: 16

# Offense count: 31
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: prefer_alias, prefer_alias_method
Style/Alias:
Exclude:
- 'lib/selenium/webdriver/common/driver.rb'
- 'lib/selenium/webdriver/common/driver_extensions/rotatable.rb'
- 'lib/selenium/webdriver/common/element.rb'
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'
- 'lib/selenium/webdriver/common/proxy.rb'
- 'lib/selenium/webdriver/remote/bridge.rb'
- 'lib/selenium/webdriver/remote/capabilities.rb'
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
- 'lib/selenium/webdriver/support/color.rb'
- 'spec/integration/selenium/webdriver/spec_support/guards.rb'

# Offense count: 3
Style/AsciiComments:
Exclude:
- 'lib/selenium/webdriver/common/w3c_error.rb'

# Offense count: 5
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/selenium/webdriver/remote/commands.rb'
- 'lib/selenium/webdriver/remote/w3c_commands.rb'
- 'spec/integration/selenium/webdriver/app_cache_spec.rb'
- 'spec/integration/selenium/webdriver/storage_spec.rb'
- 'spec/integration/selenium/webdriver/touch_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: Keywords.
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
Style/CommentAnnotation:
Exclude:
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
- 'spec/integration/selenium/webdriver/window_spec.rb'

# Offense count: 1
Style/ConstantName:
Exclude:
- 'lib/selenium/webdriver/common/error.rb'

# Offense count: 84
Style/Documentation:
Enabled: false

# Offense count: 53
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Style/DotPosition:
Enabled: false

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
Style/FileName:
Exclude:
- 'lib/selenium-webdriver.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
Style/FirstParameterIndentation:
Exclude:
- 'spec/integration/selenium/webdriver/storage_spec.rb'

# Offense count: 5
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: format, sprintf, percent
Style/FormatString:
Exclude:
- 'lib/selenium/webdriver/common/driver.rb'
- 'lib/selenium/webdriver/common/element.rb'
- 'lib/selenium/webdriver/safari/server.rb'
- 'lib/selenium/webdriver/support/color.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: normal, rails
Style/IndentationConsistency:
Exclude:
- 'spec/unit/selenium/webdriver/remote/http/default_spec.rb'

# Offense count: 6
# Cop supports --auto-correct.
Style/LineEndConcatenation:
Exclude:
- 'lib/selenium/webdriver/common/window.rb'
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/MethodCallParentheses:
Exclude:
- 'lib/selenium/webdriver/remote/response.rb'
- 'spec/integration/selenium/webdriver/chrome/profile_spec.rb'
- 'spec/integration/selenium/webdriver/firefox/profile_spec.rb'

# Offense count: 187
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: snake_case, camelCase
Style/MethodName:
Enabled: false

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineOperationIndentation:
Enabled: false

# Offense count: 33
# Cop supports --auto-correct.
Style/MutableConstant:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
Style/Not:
Exclude:
- 'lib/selenium/webdriver/common/socket_poller.rb'
- 'lib/selenium/webdriver/remote/http/default.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 6

# Offense count: 8
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/selenium/webdriver/common/element.rb'
- 'lib/selenium/webdriver/common/touch_screen.rb'
- 'lib/selenium/webdriver/firefox/profile.rb'
- 'lib/selenium/webdriver/remote/http/common.rb'
- 'spec/integration/selenium/webdriver/spec_support/shared_examples/concurrent_driver.rb'
- 'spec/unit/selenium/server_spec.rb'
- 'spec/unit/selenium/webdriver/remote/capabilities_spec.rb'
- 'spec/unit/selenium/webdriver/support/event_firing_spec.rb'

# Offense count: 28
# Cop supports --auto-correct.
Style/PerlBackrefs:
Exclude:
- 'lib/selenium/webdriver/common/bridge_helper.rb'
- 'lib/selenium/webdriver/firefox/profile.rb'
- 'lib/selenium/webdriver/firefox/profiles_ini.rb'
- 'lib/selenium/webdriver/remote/capabilities.rb'
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
- 'lib/selenium/webdriver/support/color.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'spec/integration/selenium/webdriver/spec_support/test_environment.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/RescueModifier:
Exclude:
- 'lib/selenium/webdriver/firefox/service.rb'
- 'lib/selenium/webdriver/phantomjs/service.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Style/Semicolon:
Exclude:
- 'spec/unit/selenium/webdriver/file_reaper_spec.rb'
- 'spec/unit/selenium/webdriver/support/color_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowIfMethodIsEmpty.
Style/SingleLineMethods:
Exclude:
- 'spec/unit/selenium/webdriver/firefox/extension_spec.rb'
- 'spec/unit/selenium/webdriver/wait_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles.
# SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars:
EnforcedStyle: use_perl_names

# Offense count: 1406
# Offense count: 1398
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Enabled: false

# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma
Style/TrailingCommaInLiteral:
Exclude:
- 'lib/selenium/webdriver/android/bridge.rb'
- 'lib/selenium/webdriver/common/search_context.rb'
- 'lib/selenium/webdriver/firefox/binary.rb'
- 'lib/selenium/webdriver/iphone/bridge.rb'
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
- 'lib/selenium/webdriver/safari/options.rb'
- 'spec/unit/selenium/webdriver/proxy_spec.rb'
- 'spec/unit/selenium/webdriver/safari/bridge_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
Style/TrivialAccessors:
Exclude:
- 'lib/selenium/webdriver/common/driver.rb'
- 'lib/selenium/webdriver/common/element.rb'
- 'lib/selenium/webdriver/common/file_reaper.rb'
- 'lib/selenium/webdriver/remote/capabilities.rb'
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/WhileUntilModifier:
Exclude:
- 'lib/selenium/webdriver/common/socket_lock.rb'
- 'lib/selenium/webdriver/safari/server.rb'

# Offense count: 1
Style/ZeroLengthPredicate:
Exclude:
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/android/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ module Android
#

class Bridge < Remote::Bridge
DEFAULT_URL = "http://#{Platform.localhost}:8080/wd/hub/"
DEFAULT_URL = "http://#{Platform.localhost}:8080/wd/hub/".freeze

def initialize(opts = {})
warn 'The Android driver is deprecated - please use either http://selendroid.io or http://appium.io instead.'

remote_opts = {
url: opts.fetch(:url, DEFAULT_URL),
desired_capabilities: opts.fetch(:desired_capabilities, capabilities),
desired_capabilities: opts.fetch(:desired_capabilities, capabilities)
}

remote_opts[:http_client] = opts[:http_client] if opts.key?(:http_client)
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/chrome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
module Selenium
module WebDriver
module Chrome
MISSING_TEXT = "Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver."
MISSING_TEXT = "Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.".freeze

def self.driver_path=(path)
Platform.assert_executable path
Expand Down
Loading

0 comments on commit cccc9fe

Please sign in to comment.