Skip to content

Commit cccc9fe

Browse files
committed
rb - all the style updates
1 parent 6ec0748 commit cccc9fe

File tree

90 files changed

+1943
-2140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1943
-2140
lines changed

rb/.rubocop.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,36 @@ Style/SpaceInsideHashLiteralBraces:
99
Style/BracesAroundHashParameters:
1010
EnforcedStyle: context_dependent
1111

12-
Lint/AssignmentInCondition:
12+
Style/Alias:
13+
EnforcedStyle: prefer_alias_method
14+
15+
Lint/HandleExceptions:
1316
Enabled: false
1417

1518
Style/PercentLiteralDelimiters:
1619
PreferredDelimiters:
1720
'%i': '[]'
1821
'%w': '[]'
22+
23+
# Consider documenting all top-level classes and modules
24+
Style/Documentation:
25+
Enabled: false
26+
27+
# Port Integers do not need underscores
28+
Style/NumericLiterals:
29+
Enabled: false
30+
31+
# Bug
32+
Style/FileName:
33+
Exclude:
34+
- 'lib/selenium-webdriver.rb'
35+
36+
# These need to be fixed
37+
Style/MutableConstant:
38+
Exclude:
39+
- 'lib/selenium/webdriver/remote/bridge.rb'
40+
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
41+
42+
# There shouldn't be any reason to use camel case instead of snake case here
43+
Style/MethodName:
44+
Enabled: false

rb/.rubocop_todo.yml

Lines changed: 6 additions & 291 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2016-06-09 16:27:16 -0700 using RuboCop version 0.37.2.
3+
# on 2016-06-10 10:26:32 -0700 using RuboCop version 0.37.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 10
10-
Lint/HandleExceptions:
11-
Exclude:
12-
- 'lib/selenium/server.rb'
13-
- 'lib/selenium/webdriver/common/platform.rb'
14-
- 'lib/selenium/webdriver/common/socket_poller.rb'
15-
- 'lib/selenium/webdriver/common/wait.rb'
16-
- 'lib/selenium/webdriver/firefox/binary.rb'
17-
- 'lib/selenium/webdriver/remote/bridge.rb'
18-
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
19-
- 'spec/integration/selenium/webdriver/spec_support/test_environment.rb'
20-
21-
# Offense count: 1
22-
Lint/UselessAccessModifier:
23-
Exclude:
24-
- 'lib/selenium/webdriver/support/select.rb'
25-
26-
# Offense count: 3
27-
Lint/UselessAssignment:
28-
Exclude:
29-
- 'lib/selenium/webdriver/firefox/profiles_ini.rb'
30-
- 'spec/integration/selenium/webdriver/touch_spec.rb'
31-
- 'spec/unit/selenium/webdriver/support/color_spec.rb'
32-
33-
# Offense count: 2
34-
Lint/Void:
35-
Exclude:
36-
- 'spec/integration/selenium/webdriver/touch_spec.rb'
37-
389
# Offense count: 41
3910
Metrics/AbcSize:
4011
Max: 53
@@ -48,285 +19,29 @@ Metrics/ClassLength:
4819
Metrics/CyclomaticComplexity:
4920
Max: 16
5021

51-
# Offense count: 706
22+
# Offense count: 637
5223
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
5324
# URISchemes: http, https
5425
Metrics/LineLength:
55-
Max: 319
26+
Max: 321
5627

5728
# Offense count: 61
5829
# Configuration parameters: CountComments.
5930
Metrics/MethodLength:
6031
Max: 37
6132

62-
# Offense count: 3
33+
# Offense count: 7
6334
# Configuration parameters: CountComments.
6435
Metrics/ModuleLength:
65-
Max: 222
36+
Max: 238
6637

6738
# Offense count: 15
6839
Metrics/PerceivedComplexity:
6940
Max: 16
7041

71-
# Offense count: 31
72-
# Cop supports --auto-correct.
73-
# Configuration parameters: EnforcedStyle, SupportedStyles.
74-
# SupportedStyles: prefer_alias, prefer_alias_method
75-
Style/Alias:
76-
Exclude:
77-
- 'lib/selenium/webdriver/common/driver.rb'
78-
- 'lib/selenium/webdriver/common/driver_extensions/rotatable.rb'
79-
- 'lib/selenium/webdriver/common/element.rb'
80-
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'
81-
- 'lib/selenium/webdriver/common/proxy.rb'
82-
- 'lib/selenium/webdriver/remote/bridge.rb'
83-
- 'lib/selenium/webdriver/remote/capabilities.rb'
84-
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
85-
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
86-
- 'lib/selenium/webdriver/support/color.rb'
87-
- 'spec/integration/selenium/webdriver/spec_support/guards.rb'
88-
89-
# Offense count: 3
90-
Style/AsciiComments:
91-
Exclude:
92-
- 'lib/selenium/webdriver/common/w3c_error.rb'
93-
94-
# Offense count: 5
95-
# Configuration parameters: EnforcedStyle, SupportedStyles.
96-
# SupportedStyles: nested, compact
97-
Style/ClassAndModuleChildren:
98-
Exclude:
99-
- 'lib/selenium/webdriver/remote/commands.rb'
100-
- 'lib/selenium/webdriver/remote/w3c_commands.rb'
101-
- 'spec/integration/selenium/webdriver/app_cache_spec.rb'
102-
- 'spec/integration/selenium/webdriver/storage_spec.rb'
103-
- 'spec/integration/selenium/webdriver/touch_spec.rb'
104-
105-
# Offense count: 3
106-
# Cop supports --auto-correct.
107-
# Configuration parameters: Keywords.
108-
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
109-
Style/CommentAnnotation:
110-
Exclude:
111-
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
112-
- 'spec/integration/selenium/webdriver/window_spec.rb'
113-
114-
# Offense count: 1
115-
Style/ConstantName:
116-
Exclude:
117-
- 'lib/selenium/webdriver/common/error.rb'
118-
119-
# Offense count: 84
120-
Style/Documentation:
121-
Enabled: false
122-
123-
# Offense count: 53
124-
# Cop supports --auto-correct.
125-
# Configuration parameters: EnforcedStyle, SupportedStyles.
126-
# SupportedStyles: leading, trailing
127-
Style/DotPosition:
128-
Enabled: false
129-
130-
# Offense count: 1
131-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
132-
Style/FileName:
133-
Exclude:
134-
- 'lib/selenium-webdriver.rb'
135-
136-
# Offense count: 1
137-
# Cop supports --auto-correct.
138-
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
139-
# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
140-
Style/FirstParameterIndentation:
141-
Exclude:
142-
- 'spec/integration/selenium/webdriver/storage_spec.rb'
143-
144-
# Offense count: 5
145-
# Configuration parameters: EnforcedStyle, SupportedStyles.
146-
# SupportedStyles: format, sprintf, percent
147-
Style/FormatString:
148-
Exclude:
149-
- 'lib/selenium/webdriver/common/driver.rb'
150-
- 'lib/selenium/webdriver/common/element.rb'
151-
- 'lib/selenium/webdriver/safari/server.rb'
152-
- 'lib/selenium/webdriver/support/color.rb'
153-
154-
# Offense count: 1
155-
# Cop supports --auto-correct.
156-
# Configuration parameters: EnforcedStyle, SupportedStyles.
157-
# SupportedStyles: normal, rails
158-
Style/IndentationConsistency:
159-
Exclude:
160-
- 'spec/unit/selenium/webdriver/remote/http/default_spec.rb'
161-
162-
# Offense count: 6
163-
# Cop supports --auto-correct.
164-
Style/LineEndConcatenation:
165-
Exclude:
166-
- 'lib/selenium/webdriver/common/window.rb'
167-
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
168-
169-
# Offense count: 3
170-
# Cop supports --auto-correct.
171-
Style/MethodCallParentheses:
172-
Exclude:
173-
- 'lib/selenium/webdriver/remote/response.rb'
174-
- 'spec/integration/selenium/webdriver/chrome/profile_spec.rb'
175-
- 'spec/integration/selenium/webdriver/firefox/profile_spec.rb'
176-
177-
# Offense count: 187
178-
# Configuration parameters: EnforcedStyle, SupportedStyles.
179-
# SupportedStyles: snake_case, camelCase
180-
Style/MethodName:
181-
Enabled: false
182-
183-
# Offense count: 3
184-
# Cop supports --auto-correct.
185-
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
186-
# SupportedStyles: aligned, indented
187-
Style/MultilineOperationIndentation:
188-
Enabled: false
189-
190-
# Offense count: 33
191-
# Cop supports --auto-correct.
192-
Style/MutableConstant:
193-
Enabled: false
194-
195-
# Offense count: 2
196-
# Cop supports --auto-correct.
197-
Style/Not:
198-
Exclude:
199-
- 'lib/selenium/webdriver/common/socket_poller.rb'
200-
- 'lib/selenium/webdriver/remote/http/default.rb'
201-
202-
# Offense count: 2
203-
# Cop supports --auto-correct.
204-
Style/NumericLiterals:
205-
MinDigits: 6
206-
207-
# Offense count: 8
208-
# Cop supports --auto-correct.
209-
Style/ParallelAssignment:
210-
Exclude:
211-
- 'lib/selenium/webdriver/common/element.rb'
212-
- 'lib/selenium/webdriver/common/touch_screen.rb'
213-
- 'lib/selenium/webdriver/firefox/profile.rb'
214-
- 'lib/selenium/webdriver/remote/http/common.rb'
215-
- 'spec/integration/selenium/webdriver/spec_support/shared_examples/concurrent_driver.rb'
216-
- 'spec/unit/selenium/server_spec.rb'
217-
- 'spec/unit/selenium/webdriver/remote/capabilities_spec.rb'
218-
- 'spec/unit/selenium/webdriver/support/event_firing_spec.rb'
219-
220-
# Offense count: 28
221-
# Cop supports --auto-correct.
222-
Style/PerlBackrefs:
223-
Exclude:
224-
- 'lib/selenium/webdriver/common/bridge_helper.rb'
225-
- 'lib/selenium/webdriver/firefox/profile.rb'
226-
- 'lib/selenium/webdriver/firefox/profiles_ini.rb'
227-
- 'lib/selenium/webdriver/remote/capabilities.rb'
228-
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
229-
- 'lib/selenium/webdriver/support/color.rb'
230-
231-
# Offense count: 1
232-
# Cop supports --auto-correct.
233-
Style/RedundantParentheses:
234-
Exclude:
235-
- 'spec/integration/selenium/webdriver/spec_support/test_environment.rb'
236-
237-
# Offense count: 1
238-
# Cop supports --auto-correct.
239-
# Configuration parameters: AllowMultipleReturnValues.
240-
Style/RedundantReturn:
241-
Exclude:
242-
- 'lib/selenium/webdriver/remote/w3c_bridge.rb'
243-
244-
# Offense count: 1
245-
# Cop supports --auto-correct.
246-
Style/RedundantSelf:
247-
Exclude:
248-
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'
249-
250-
# Offense count: 2
251-
# Cop supports --auto-correct.
252-
Style/RescueModifier:
253-
Exclude:
254-
- 'lib/selenium/webdriver/firefox/service.rb'
255-
- 'lib/selenium/webdriver/phantomjs/service.rb'
256-
257-
# Offense count: 2
258-
# Cop supports --auto-correct.
259-
# Configuration parameters: AllowAsExpressionSeparator.
260-
Style/Semicolon:
261-
Exclude:
262-
- 'spec/unit/selenium/webdriver/file_reaper_spec.rb'
263-
- 'spec/unit/selenium/webdriver/support/color_spec.rb'
264-
265-
# Offense count: 2
266-
# Cop supports --auto-correct.
267-
# Configuration parameters: AllowIfMethodIsEmpty.
268-
Style/SingleLineMethods:
269-
Exclude:
270-
- 'spec/unit/selenium/webdriver/firefox/extension_spec.rb'
271-
- 'spec/unit/selenium/webdriver/wait_spec.rb'
272-
273-
# Offense count: 2
274-
# Cop supports --auto-correct.
275-
# Configuration parameters: SupportedStyles.
276-
# SupportedStyles: use_perl_names, use_english_names
277-
Style/SpecialGlobalVars:
278-
EnforcedStyle: use_perl_names
279-
280-
# Offense count: 1406
42+
# Offense count: 1398
28143
# Cop supports --auto-correct.
28244
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
28345
# SupportedStyles: single_quotes, double_quotes
28446
Style/StringLiterals:
28547
Enabled: false
286-
287-
# Offense count: 1
288-
# Cop supports --auto-correct.
289-
# Configuration parameters: EnforcedStyle, SupportedStyles.
290-
# SupportedStyles: single_quotes, double_quotes
291-
Style/StringLiteralsInInterpolation:
292-
Enabled: false
293-
294-
# Offense count: 9
295-
# Cop supports --auto-correct.
296-
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
297-
# SupportedStyles: comma, consistent_comma, no_comma
298-
Style/TrailingCommaInLiteral:
299-
Exclude:
300-
- 'lib/selenium/webdriver/android/bridge.rb'
301-
- 'lib/selenium/webdriver/common/search_context.rb'
302-
- 'lib/selenium/webdriver/firefox/binary.rb'
303-
- 'lib/selenium/webdriver/iphone/bridge.rb'
304-
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
305-
- 'lib/selenium/webdriver/safari/options.rb'
306-
- 'spec/unit/selenium/webdriver/proxy_spec.rb'
307-
- 'spec/unit/selenium/webdriver/safari/bridge_spec.rb'
308-
309-
# Offense count: 5
310-
# Cop supports --auto-correct.
311-
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
312-
# 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
313-
Style/TrivialAccessors:
314-
Exclude:
315-
- 'lib/selenium/webdriver/common/driver.rb'
316-
- 'lib/selenium/webdriver/common/element.rb'
317-
- 'lib/selenium/webdriver/common/file_reaper.rb'
318-
- 'lib/selenium/webdriver/remote/capabilities.rb'
319-
- 'lib/selenium/webdriver/remote/w3c_capabilities.rb'
320-
321-
# Offense count: 2
322-
# Cop supports --auto-correct.
323-
# Configuration parameters: MaxLineLength.
324-
Style/WhileUntilModifier:
325-
Exclude:
326-
- 'lib/selenium/webdriver/common/socket_lock.rb'
327-
- 'lib/selenium/webdriver/safari/server.rb'
328-
329-
# Offense count: 1
330-
Style/ZeroLengthPredicate:
331-
Exclude:
332-
- 'lib/selenium/webdriver/common/html5/shared_web_storage.rb'

rb/lib/selenium/webdriver/android/bridge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ module Android
2525
#
2626

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

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

3333
remote_opts = {
3434
url: opts.fetch(:url, DEFAULT_URL),
35-
desired_capabilities: opts.fetch(:desired_capabilities, capabilities),
35+
desired_capabilities: opts.fetch(:desired_capabilities, capabilities)
3636
}
3737

3838
remote_opts[:http_client] = opts[:http_client] if opts.key?(:http_client)

rb/lib/selenium/webdriver/chrome.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
module Selenium
2727
module WebDriver
2828
module Chrome
29-
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."
29+
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
3030

3131
def self.driver_path=(path)
3232
Platform.assert_executable path

0 commit comments

Comments
 (0)