Skip to content

Commit e43e54d

Browse files
authored
Add isort to pre-commit (appium#379)
* Add isort to pre-commit * Add isort.conf * Applied isort for test/unit * Add current dir to isrot arg * Add check to ci.sh * Use exit code for condition check in ci.sh
1 parent cb39903 commit e43e54d

Some content is hidden

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

72 files changed

+105
-87
lines changed

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
multi_line_output = 3
3+
known_third_party = dateutil,httpretty,pytest,selenium,setuptools,urllib3

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
hooks:
44
- id: autopep8
55
args: ["--global-config", ".config-pep8", "-i"]
6+
- repo: https://github.com/pre-commit/mirrors-isort
7+
rev: v4.3.20
8+
hooks:
9+
- id: isort
10+
args: ["-rc", "."]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz).
4444
```
4545
$ python -m autopep8 -r --global-config .config-pep8 -i .
4646
```
47+
- `isort` helps to order imports automatically
48+
```
49+
$ python -m isort -rc .
50+
```
4751
- You can customise `CHANGELOG.rst` with commit messages following [.gitchangelog.rc](.gitchangelog.rc)
4852
- It generates readable changelog
4953
- Setup

appium/saucetestcase.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
from __future__ import print_function
1818

19-
import unittest
2019
import os
2120
import sys
21+
import unittest
22+
2223
from appium import webdriver
2324
from sauceclient import SauceClient
2425

appium/webdriver/appium_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import subprocess
1818
import sys
1919
import time
20+
2021
import urllib3
2122

2223
DEFAULT_HOST = '127.0.0.1'

appium/webdriver/errorhandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from selenium.webdriver.remote import errorhandler
1615
from selenium.common.exceptions import WebDriverException
16+
from selenium.webdriver.remote import errorhandler
1717

1818
from appium.common.exceptions import NoSuchContextException
1919

appium/webdriver/extensions/android/activities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from selenium import webdriver
1616
from selenium.common.exceptions import TimeoutException
1717
from selenium.webdriver.support.ui import WebDriverWait
18+
1819
from appium.webdriver.mobilecommand import MobileCommand as Command
1920

2021

appium/webdriver/extensions/android/gsm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16-
from appium.webdriver.mobilecommand import MobileCommand as Command
1716

18-
from appium.common.logger import logger
1917
from appium.common.helper import extract_const_attributes
18+
from appium.common.logger import logger
19+
from appium.webdriver.mobilecommand import MobileCommand as Command
2020

2121

2222
class GsmCallActions(object):

appium/webdriver/extensions/android/network.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16+
1617
from appium.webdriver.mobilecommand import MobileCommand as Command
1718

1819

appium/webdriver/extensions/android/performance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
from selenium import webdriver
16+
1617
from appium.webdriver.mobilecommand import MobileCommand as Command
1718

1819

0 commit comments

Comments
 (0)