Skip to content

Commit

Permalink
Update all dependencies
Browse files Browse the repository at this point in the history
In particular this upgrades RuboCop and addresses some of its offenses
  • Loading branch information
p0deje committed May 28, 2020
1 parent 5816be6 commit b786b11
Show file tree
Hide file tree
Showing 44 changed files with 41 additions and 11 deletions.
1 change: 1 addition & 0 deletions rake_tasks/crazy_fun/mappings/ruby_mappings/ruby_linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def handle(_fun, dir, args)
desc 'Run RuboCop'
task task_name(dir, args[:name]) => args[:deps] do
ruby :command => 'rubocop',
:args => args[:args],
:files => args[:srcs]
end
end
Expand Down
39 changes: 33 additions & 6 deletions rb/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ AllCops:
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent

Style/BlockDelimiters:
EnforcedStyle: braces_for_chaining

Style/Alias:
EnforcedStyle: prefer_alias_method

Lint/HandleExceptions:
Lint/SuppressedException:
Enabled: false

Style/RegexpLiteral:
Expand All @@ -36,7 +33,7 @@ Naming/FileName:
Exclude:
- 'lib/selenium-webdriver.rb'

Naming/UncommunicativeMethodParamName:
Naming/MethodParameterName:
AllowedNames:
- x
- y
Expand Down Expand Up @@ -72,7 +69,7 @@ Metrics/AbcSize:
- 'lib/selenium/webdriver/remote/http/curb.rb'
- 'lib/selenium/webdriver/support/color.rb'

Metrics/LineLength:
Layout/LineLength:
Max: 130
IgnoredPatterns:
- '\s+# rubocop'
Expand Down Expand Up @@ -145,3 +142,33 @@ RSpec/InstanceVariable:

RSpec/DescribedClass:
EnforcedStyle: explicit

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/SlicingWithRange:
Enabled: true
1 change: 1 addition & 0 deletions rb/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ ruby_class_call(name = "cdp",
)

ruby_lint(name = "lint",
args = ["--config=rb/.rubocop.yml"],
srcs = [
"lib/**/*.rb",
"spec/**/*.rb",
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/devtools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# specific language governing permissions and limitations
# under the License.

Dir["#{__dir__}/devtools/*"].each { |f| require f }
Dir["#{__dir__}/devtools/*"].sort.each { |f| require f }

module Selenium
module WebDriver
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Bridge

def initialize(http_client: nil, url:)
uri = url.is_a?(URI) ? url : URI.parse(url)
uri.path += '/' unless %r{\/$}.match?(uri.path)
uri.path += '/' unless uri.path.end_with?('/')

@http = http_client || Http::Default.new
@http.server_url = uri
Expand Down
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/support/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def self.from_string(str)
end
end

def self.from_hsl(h, s, l, a) # rubocop:disable Naming/UncommunicativeMethodParamName
def self.from_hsl(h, s, l, a) # rubocop:disable Naming/MethodParameterName
h = Float(h) / 360
s = Float(s) / 100
l = Float(l) / 100
Expand Down Expand Up @@ -138,7 +138,7 @@ def rgba
end

def hex
format '#%02x%02x%02x', red, green, blue
format '#%<red>02x%<green>02x%<blue>02x', red: red, green: green, blue: blue
end
end # Color
end # Support
Expand Down
2 changes: 1 addition & 1 deletion rb/selenium-webdriver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rack', ['~> 2.0']
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', ['~> 3.0']
s.add_development_dependency 'rubocop', ['~> 0.73.0']
s.add_development_dependency 'rubocop', ['~> 0.84.0']
s.add_development_dependency 'rubocop-performance'
s.add_development_dependency 'rubocop-rspec'
s.add_development_dependency 'webmock', ['~> 3.5']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module DriverExtensions
Class.new(WebDriver::Driver) do
include HasNetworkConnection
attr_reader :bridge

def initialize(bridge)
@bridge = bridge
end
Expand Down
Binary file removed third_party/rb/vendor/cache/ffi-1.11.3.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/ffi-1.12.2.gem
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/hashdiff-1.0.0.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/hashdiff-1.0.1.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/parser-2.6.5.0.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/parser-2.7.1.3.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rack-2.0.8.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/rack-2.2.2.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/rexml-3.2.4.gem
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rspec-core-3.9.0.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/rspec-core-3.9.2.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rspec-mocks-3.9.0.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rubocop-0.73.0.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/rubocop-0.84.0.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rubocop-rspec-1.37.1.gem
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/rubyzip-2.0.0.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/rubyzip-2.3.0.gem
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/webmock-3.7.6.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/webmock-3.8.3.gem
Binary file not shown.
Binary file removed third_party/rb/vendor/cache/yard-0.9.20.gem
Binary file not shown.
Binary file added third_party/rb/vendor/cache/yard-0.9.25.gem
Binary file not shown.

0 comments on commit b786b11

Please sign in to comment.