Skip to content

Commit 59e6351

Browse files
authored
chore(lint): added isort for import sorting (#75)
1 parent 91c54d9 commit 59e6351

Some content is hidden

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

51 files changed

+135
-114
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ jobs:
2121
pip install -r local-requirements.txt
2222
pip install .
2323
- name: Lint
24-
run: |
25-
black --check .
26-
mypy .
27-
flake8 playwright tests
24+
run: pre-commit run --all-files
2825
build:
2926
timeout-minutes: 30
3027
strategy:

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ repos:
2020
rev: 'a7be77f761a4c29121d6bb6f61c11902281f9105'
2121
hooks:
2222
- id: flake8
23+
- repo: https://github.com/pre-commit/mirrors-isort
24+
rev: v5.1.3
25+
hooks:
26+
- id: isort

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Instead, please report them to the Microsoft Security Response Center (MSRC) at
1414

1515
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
1616

17-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
1818

1919
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
2020

@@ -38,4 +38,4 @@ We prefer all communications to be in English.
3838

3939
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
4040

41-
<!-- END MICROSOFT SECURITY.MD BLOCK -->
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

playwright/__init__.py

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

15+
import playwright.helper as helper
1516
from playwright._repo_version import version as __version__ # noqa:F401
1617
from playwright.main import playwright_object
17-
import playwright.helper as helper
1818

1919
chromium = playwright_object.chromium
2020
firefox = playwright_object.firefox

playwright/accessibility.py

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

15+
from typing import Dict
16+
1517
from playwright.connection import Channel
1618
from playwright.element_handle import ElementHandle
17-
from typing import Dict
1819

1920

2021
class Accessibility:

playwright/browser.py

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

1515
import sys
16+
from types import SimpleNamespace
17+
from typing import Dict, List, Union
18+
1619
from playwright.browser_context import BrowserContext
1720
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
18-
from playwright.helper import locals_to_params, ColorScheme
21+
from playwright.helper import ColorScheme, locals_to_params
1922
from playwright.network import serialize_headers
2023
from playwright.page import Page
21-
from types import SimpleNamespace
22-
from typing import Dict, List, Union
2324

2425
if sys.version_info >= (3, 8): # pragma: no cover
2526
from typing import Literal

playwright/browser_context.py

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

1515
import asyncio
16-
from playwright.connection import (
17-
ChannelOwner,
18-
ConnectionScope,
19-
from_channel,
20-
)
16+
from types import SimpleNamespace
17+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
18+
19+
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
2120
from playwright.helper import (
2221
Cookie,
2322
Error,
@@ -31,8 +30,6 @@
3130
)
3231
from playwright.network import Request, Route, serialize_headers
3332
from playwright.page import BindingCall, Page, wait_for_event
34-
from types import SimpleNamespace
35-
from typing import Any, Callable, Dict, List, Optional, Union, TYPE_CHECKING
3633

3734
if TYPE_CHECKING: # pragma: no cover
3835
from playwright.browser import Browser

playwright/browser_server.py

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

15-
from playwright.connection import ChannelOwner, ConnectionScope
1615
from types import SimpleNamespace
1716
from typing import Dict
1817

18+
from playwright.connection import ChannelOwner, ConnectionScope
19+
1920

2021
class BrowserServer(ChannelOwner):
2122

playwright/browser_type.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
15+
from typing import Dict, List
16+
1617
from playwright.browser import Browser
1718
from playwright.browser_context import BrowserContext
18-
from playwright.helper import locals_to_params, ColorScheme
19-
from typing import Dict, List
19+
from playwright.connection import ChannelOwner, ConnectionScope, from_channel
20+
from playwright.helper import ColorScheme, locals_to_params
2021

2122

2223
class BrowserType(ChannelOwner):

playwright/connection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
import asyncio
1616
import sys
1717
import traceback
18-
from playwright.helper import parse_error, ParsedMessagePayload
19-
from playwright.transport import Transport
20-
from pyee import BaseEventEmitter
2118
from typing import Any, Dict, List, Optional
2219

20+
from pyee import BaseEventEmitter
21+
22+
from playwright.helper import ParsedMessagePayload, parse_error
23+
from playwright.transport import Transport
24+
2325

2426
class Channel(BaseEventEmitter):
2527
def __init__(self, scope: "ConnectionScope", guid: str) -> None:

0 commit comments

Comments
 (0)