Skip to content

Commit

Permalink
Reduce usage of # noqa.
Browse files Browse the repository at this point in the history
Specify which warnings are ignored.
  • Loading branch information
aaugustin committed Apr 2, 2023
1 parent 5b376aa commit 5c7a442
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/websockets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from __future__ import annotations

from .imports import lazy_import
from .version import version as __version__ # noqa
from .version import version as __version__ # noqa: F401


__all__ = [ # noqa
__all__ = [
"AbortHandshake",
"basic_auth_protocol_factory",
"BasicAuthWebSocketServerProtocol",
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


try:
import readline # noqa
import readline # noqa: F401
except ImportError: # Windows has no `readline` normally
pass

Expand Down
2 changes: 1 addition & 1 deletion src/websockets/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

# See #940 for why lazy_import isn't used here for backwards compatibility.
from .legacy.auth import * # noqa
from .legacy.auth import *
4 changes: 2 additions & 2 deletions src/websockets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


# See #940 for why lazy_import isn't used here for backwards compatibility.
from .legacy.client import * # isort:skip # noqa
from .legacy.client import * # isort:skip # noqa: I001


__all__ = ["ClientProtocol"]
Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(
self.available_subprotocols = subprotocols
self.key = generate_key()

def connect(self) -> Request: # noqa: F811
def connect(self) -> Request:
"""
Create a handshake request to open a connection.
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings

# lazy_import doesn't support this use case.
from .protocol import SEND_EOF, Protocol as Connection, Side, State # noqa
from .protocol import SEND_EOF, Protocol as Connection, Side, State # noqa: F401


warnings.warn(
Expand Down
7 changes: 5 additions & 2 deletions src/websockets/legacy/framing.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ def write(


# Backwards compatibility with previously documented public APIs

from ..frames import Close, prepare_ctrl as encode_data, prepare_data # noqa
from ..frames import ( # noqa: E402, F401, I001
Close,
prepare_ctrl as encode_data,
prepare_data,
)


def parse_close(data: bytes) -> Tuple[int, str]:
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


# See #940 for why lazy_import isn't used here for backwards compatibility.
from .legacy.server import * # isort:skip # noqa
from .legacy.server import * # isort:skip # noqa: I001


__all__ = ["ServerProtocol"]
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from websockets.extensions.base import * # noqa
from websockets.extensions.base import *


# Abstract classes don't provide any behavior to test.
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from websockets.auth import * # noqa
from websockets.auth import *
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from websockets.http import * # noqa
from websockets.http import *
2 changes: 1 addition & 1 deletion tests/test_typing.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from websockets.typing import * # noqa
from websockets.typing import *

0 comments on commit 5c7a442

Please sign in to comment.