Skip to content

Commit 8e7abee

Browse files
authored
Bump rubocop 23 (#855)
* fix find_element_by_image * update changelog * update frozen string * fix const name * fix memorized name * fix some rubocop warnings * fix string literal * bump ruby core * remove update
1 parent 6e97483 commit 8e7abee

File tree

118 files changed

+1727
-143
lines changed

Some content is hidden

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

118 files changed

+1727
-143
lines changed

.rubocop.yml

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.2
2+
TargetRubyVersion: 2.3
33
Metrics/LineLength:
44
Max: 128
55
Metrics/MethodLength:
@@ -23,15 +23,8 @@ Style/RegexpLiteral:
2323
# blocked on https://github.com/appium/ruby_lib/issues/312. Already removed from core part
2424
Style/GlobalVars:
2525
Enabled: false
26-
Style/DoubleNegation:
27-
Enabled: false
28-
Style/EachWithObject:
29-
Enabled: false
3026
Style/PercentLiteralDelimiters:
3127
Enabled: false
32-
# Should enable and fix for Ruby3
33-
Style/FrozenStringLiteralComment:
34-
Enabled: false
3528
# Can use over Ruby2.3
3629
Style/SafeNavigation:
3730
Enabled: false
@@ -40,14 +33,8 @@ Style/NumericPredicate:
4033
Enabled: false
4134
Style/CommentedKeyword:
4235
Enabled: false
43-
Lint/NestedMethodDefinition:
44-
Enabled: false
45-
Naming/ConstantName:
46-
Enabled: false
4736
Naming/AccessorMethodName:
4837
Enabled: false
49-
Naming/MemoizedInstanceVariableName:
50-
Enabled: false
5138
Layout/IndentHeredoc:
5239
Enabled: false
5340
Layout/RescueEnsureAlignment:

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ rvm:
88
- 2.5
99
- 2.6
1010

11-
before_install:
12-
- gem update bundler
1311
install:
1412
- bundle install --retry=3
1513
script:

Gemfile

+14
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
source 'https://rubygems.org'
216
gemspec

Rakefile

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
require 'bundler/gem_tasks'
216
require 'rubocop/rake_task'
317

android_tests/Gemfile

+14
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
source 'https://rubygems.org'
216
gemspec path: File.expand_path('..', __dir__) # __dir__ fails on 1.9

android_tests/Rakefile

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
require 'rubygems'
216
require 'rake'
317
require 'rubocop/rake_task'

android_tests/lib/android/sauce_labs.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake ios[sauce_labs]
216
describe 'sauce_labs' do
317
t 'sauce settings' do

android_tests/lib/android/specs/android/element/alert.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[android/element/alert]
216
describe 'android/element/alert' do
317
def open_alert

android_tests/lib/android/specs/android/element/button.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android['android/element/button']
216
describe 'android/element/button' do
317
def before_first

android_tests/lib/android/specs/android/element/generic.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android['android/element/generic']
216
describe 'android/element/generic' do
317
def content

android_tests/lib/android/specs/android/element/text.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android['android/element/text']
216
describe 'android/element/text' do
317
def must_raise_no_element

android_tests/lib/android/specs/android/element/textfield.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
describe 'android/element/textfield' do
216
def must_raise_no_element
317
proc { yield }.must_raise Selenium::WebDriver::Error::NoSuchElementError

android_tests/lib/android/specs/android/helper.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[android/helper]
216
describe 'android/helper' do
317
t 'tags' do

android_tests/lib/android/specs/android/patch.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[android/patch]
216
describe 'android/patch.rb' do
317
t 'type' do

android_tests/lib/android/specs/common/command/command.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[common/command/command]
216
describe 'common/command/command' do
317
t 'command' do

android_tests/lib/android/specs/common/device.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[common/device]
216
describe 'common/device' do
317
t 'get_performance_data_types' do

android_tests/lib/android/specs/common/device_touchaction.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[common/device_touchaction]
216
describe 'common/device_touchaction' do
317
def before_first

android_tests/lib/android/specs/common/element/window.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# rake android[common/element/window]
216
describe 'common/element/window' do
317
# rubocop:disable Lint/UnifiedInteger

android_tests/lib/android/specs/common/helper.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
describe 'common/helper' do
216
wait_opts = { timeout: 0.2, interval: 0.2 } # max_wait, interval
317

android_tests/lib/android/specs/common/patch.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# Skip:
216
# status # status patches are already tested in driver.rb
317
# execute # debug output for Pry

android_tests/lib/android/specs/common/version.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
describe 'version.rb' do
216
t '::Appium::VERSION' do
317
::Appium::VERSION.must_match(/(\d+)\.(\d+).(\d+)/)

0 commit comments

Comments
 (0)