Skip to content

Commit 2a50490

Browse files
committed
apply ruff format and check --fix
1 parent fdbd03a commit 2a50490

Some content is hidden

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

45 files changed

+96
-207
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
repos:
2-
- repo: https://github.com/PyCQA/isort
3-
rev: 5.13.2
4-
hooks:
5-
- id: isort
6-
args: [ "." ]
7-
- repo: https://github.com/pre-commit/mirrors-mypy
8-
rev: v1.10.0
9-
hooks:
10-
- id: mypy
11-
entry: mypy appium/ test/functional
12-
pass_filenames: false
13-
additional_dependencies: [types-python-dateutil==2.8.19.13]
14-
- repo: https://github.com/psf/black
15-
rev: 24.4.2
16-
hooks:
17-
- id: black
18-
args: [ ".", "-l", "120", "-S" ]
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.6.9
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
args: [ --fix ]
9+
# Run the formatter.
10+
- id: ruff-format

appium/options/android/common/adb/adb_exec_timeout_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ def adb_exec_timeout(self, value: Union[timedelta, int]) -> None:
3838
Maximum time to wait until single ADB command is executed.
3939
20000 ms by default.
4040
"""
41-
self.set_capability(
42-
ADB_EXEC_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
43-
)
41+
self.set_capability(ADB_EXEC_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value)

appium/options/android/common/app/app_wait_duration_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ def app_wait_duration(self, value: Union[timedelta, int]) -> None:
3838
Maximum amount of time to wait until the application under test is started
3939
(e.g. an activity returns the control to the caller). 20000 ms by default.
4040
"""
41-
self.set_capability(
42-
APP_WAIT_DURATION, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
43-
)
41+
self.set_capability(APP_WAIT_DURATION, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value)

appium/options/android/common/avd/avd_launch_timeout_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ def avd_launch_timeout(self, value: Union[timedelta, int]) -> None:
3838
Maximum timeout to wait until Android Emulator is started.
3939
60000 ms by default.
4040
"""
41-
self.set_capability(
42-
AVD_LAUNCH_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
43-
)
41+
self.set_capability(AVD_LAUNCH_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value)

appium/options/android/common/avd/avd_ready_timeout_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ def avd_ready_timeout(self, value: Union[timedelta, int]) -> None:
3838
Maximum timeout to wait until Android Emulator is fully booted and is ready for usage.
3939
60000 ms by default
4040
"""
41-
self.set_capability(
42-
AVD_READY_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
43-
)
41+
self.set_capability(AVD_READY_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value)

appium/options/android/common/context/auto_webview_timeout_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ def auto_webview_timeout(self, value: Union[timedelta, int]) -> None:
3838
"""
3939
Timeout to wait until a web view is available.
4040
"""
41-
self.set_capability(
42-
AUTO_WEBVIEW_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value
43-
)
41+
self.set_capability(AUTO_WEBVIEW_TIMEOUT, int(value.total_seconds() * 1000) if isinstance(value, timedelta) else value)

appium/options/android/espresso/espresso_build_config_option.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,4 @@ def espresso_build_config(self, value: Union[Dict[str, Any], str]) -> None:
4343
https://github.com/appium/appium-espresso-driver#espresso-build-config
4444
for more information on how to properly construct such config.
4545
"""
46-
self.set_capability(
47-
ESPRESSO_BUILD_CONFIG, value if isinstance(value, str) else json.dumps(value, ensure_ascii=False)
48-
)
46+
self.set_capability(ESPRESSO_BUILD_CONFIG, value if isinstance(value, str) else json.dumps(value, ensure_ascii=False))

appium/options/flutter_integration/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class FlutterOptions(
3232
FlutterServerLaunchTimeOutOption,
3333
FlutterSystemPortOption,
3434
):
35-
3635
@property
3736
def default_capabilities(self) -> Dict:
3837
return {

appium/options/flutter_integration/flutter_element_wait_timeout_option.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
class FlutterElementWaitTimeOutOption(SupportsCapabilities):
27-
2827
@property
2928
def flutter_element_wait_timeout(self) -> Optional[timedelta]:
3029
"""

appium/options/flutter_integration/flutter_enable_mock_camera_option.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from typing import Optional
1918

2019
from appium.options.common.supports_capabilities import SupportsCapabilities
2120

2221
FLUTTER_ENABLE_MOCK_CAMERA = 'flutterEnableMockCamera'
2322

2423

2524
class FlutterEnableMockCameraOption(SupportsCapabilities):
26-
2725
@property
2826
def flutter_enable_mock_camera(self) -> bool:
2927
"""

0 commit comments

Comments
 (0)