Remove pylint:disable

This commit is contained in:
mhchia
2019-08-02 23:19:36 +08:00
parent 06a9511ab4
commit 2e94fcf56c
36 changed files with 7 additions and 64 deletions

View File

@ -8,7 +8,6 @@ from .pubsub_router_interface import IPubsubRouter
class FloodSub(IPubsubRouter):
# pylint: disable=no-member
protocols: List[str]

View File

@ -12,9 +12,6 @@ from .pubsub_router_interface import IPubsubRouter
class GossipSub(IPubsubRouter):
# pylint: disable=no-member
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-public-methods
protocols: List[str]
pubsub: Pubsub
@ -50,7 +47,6 @@ class GossipSub(IPubsubRouter):
gossip_history: int = 5,
heartbeat_interval: int = 120,
) -> None:
# pylint: disable=too-many-arguments
self.protocols = list(protocols)
self.pubsub = None
@ -154,7 +150,6 @@ class GossipSub(IPubsubRouter):
await self.handle_prune(prune, sender_peer_id)
async def publish(self, msg_forwarder: ID, pubsub_msg: rpc_pb2.Message) -> None:
# pylint: disable=too-many-locals
"""
Invoked to forward a new message that has been validated.
"""
@ -182,7 +177,6 @@ class GossipSub(IPubsubRouter):
:param origin: peer id of the peer the message originate from.
:return: a generator of the peer ids who we send data to.
"""
# pylint: disable=len-as-condition
send_to: Set[ID] = set()
for topic in topic_ids:
if topic not in self.pubsub.peer_topics:
@ -367,7 +361,6 @@ class GossipSub(IPubsubRouter):
self.fanout[topic].extend(selected_peers)
async def gossip_heartbeat(self) -> None:
# pylint: disable=too-many-nested-blocks
for topic in self.mesh:
msg_ids = self.mcache.window(topic)
if msg_ids:

View File

@ -4,7 +4,6 @@ from .pb import rpc_pb2
class CacheEntry:
# pylint: disable=too-few-public-methods
mid: Tuple[bytes, bytes]
topics: List[str]

View File

@ -1,4 +1,3 @@
# pylint: disable=no-name-in-module
import asyncio
import time
from typing import Any, Dict, List, Tuple, TYPE_CHECKING
@ -23,7 +22,6 @@ def get_msg_id(msg: rpc_pb2.Message) -> Tuple[bytes, bytes]:
class Pubsub:
# pylint: disable=too-many-instance-attributes, no-member, unsubscriptable-object
host: IHost
my_id: ID
@ -144,7 +142,6 @@ class Pubsub:
for message in rpc_incoming.subscriptions:
self.handle_subscription(peer_id, message)
# pylint: disable=line-too-long
# NOTE: Check if `rpc_incoming.control` is set through `HasField`.
# This is necessary because `control` is an optional field in pb2.
# Ref: https://developers.google.com/protocol-buffers/docs/reference/python-generated#singular-fields-proto2
@ -201,7 +198,6 @@ class Pubsub:
hello: bytes = self.get_hello_packet()
await stream.write(hello)
# pylint: disable=line-too-long
# TODO: Investigate whether this should be replaced by `handlePeerEOF`
# Ref: https://github.com/libp2p/go-libp2p-pubsub/blob/49274b0e8aecdf6cad59d768e5702ff00aa48488/comm.go#L80 # noqa: E501
# Pass stream off to stream reader

View File

@ -14,7 +14,6 @@ if TYPE_CHECKING:
class PubsubNotifee(INotifee):
# pylint: disable=too-many-instance-attributes, cell-var-from-loop, unsubscriptable-object
initiator_peers_queue: "asyncio.Queue[ID]"