unidiomatic-typecheck and logging-format-interpolation issue suprressed

This commit is contained in:
lakshyacis 2020-01-21 15:48:21 +05:30
parent 1decaad156
commit fe3a98c2b6
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB
10 changed files with 12 additions and 9 deletions

View File

@ -1 +0,0 @@
src

View File

@ -117,6 +117,7 @@ class BMConfigParser(configparser.ConfigParser):
return default return default
def items(self, section, raw=False, variables=None): def items(self, section, raw=False, variables=None):
# pylint: disable=signature-differs
"""Return section variables as parent, """Return section variables as parent,
but override the "raw" argument to always True""" but override the "raw" argument to always True"""
return configparser.ConfigParser.items(self, section, True, variables) return configparser.ConfigParser.items(self, section, True, variables)

View File

@ -22,7 +22,7 @@ class MultiQueue(Queue.Queue):
Queue.Queue.__init__(self, maxsize) Queue.Queue.__init__(self, maxsize)
# Initialize the queue representation # Initialize the queue representation
def _init(self, maxsize): def _init(self, _):
self.iter = 0 self.iter = 0
self.queues = [] self.queues = []
for _ in range(self.queueCount): for _ in range(self.queueCount):

View File

@ -1,7 +1,7 @@
""" """
Bitmessage Protocol Bitmessage Protocol
""" """
# pylint: disable=attribute-defined-outside-init, too-few-public-methods # pylint: disable=attribute-defined-outside-init, too-few-public-methods, logging-format-interpolation
import base64 import base64
import hashlib import hashlib
import logging import logging
@ -123,7 +123,8 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
length=protocol.Header.size, expectBytes=self.payloadLength) length=protocol.Header.size, expectBytes=self.payloadLength)
return True return True
def state_bm_command(self): # pylint: disable=too-many-branches, too-many-statements def state_bm_command(self):
# pylint: disable=too-many-branches, too-many-statements
"""Process incoming command""" """Process incoming command"""
self.payload = self.read_buf[:self.payloadLength] self.payload = self.read_buf[:self.payloadLength]
if self.checksum != hashlib.sha512(self.payload).digest()[0:4]: if self.checksum != hashlib.sha512(self.payload).digest()[0:4]:

View File

@ -1,7 +1,7 @@
""" """
Select which node to connect to Select which node to connect to
""" """
# pylint: disable=too-many-branches # pylint: disable=too-many-branches, logging-format-interpolation, unidiomatic-typecheck
import logging import logging
import random # nosec import random # nosec

View File

@ -190,7 +190,7 @@ class BMConnectionPool(object):
def startListening(self, bind=None): def startListening(self, bind=None):
"""Open a listening socket and start accepting connections on it""" """Open a listening socket and start accepting connections on it"""
if bind is None: if bind is None:
"this return blank host" """this return blank host"""
bind = self.getListeningIP() bind = self.getListeningIP()
port = BMConfigParser().safeGetInt("bitmessagesettings", "port") port = BMConfigParser().safeGetInt("bitmessagesettings", "port")
# correct port even if it changed # correct port even if it changed

View File

@ -30,7 +30,7 @@ from network.socks5 import Socks5Connection
from network.tls import TLSDispatcher from network.tls import TLSDispatcher
from .node import Peer from .node import Peer
from queues import UISignalQueue, invQueue, receiveDataQueue from queues import UISignalQueue, invQueue, receiveDataQueue
# pylint: disable=logging-format-interpolation
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -2,7 +2,7 @@
Low-level protocol-related functions. Low-level protocol-related functions.
""" """
# pylint: disable=too-many-boolean-expressions,too-many-return-statements # pylint: disable=too-many-boolean-expressions,too-many-return-statements
# pylint: disable=too-many-locals,too-many-statements # pylint: disable=too-many-locals,too-many-statements,logging-format-interpolation
import base64 import base64
import hashlib import hashlib
@ -65,6 +65,7 @@ Header = Struct('!L12sL4s')
VersionPacket = Struct('>LqQ20s4s36sH') VersionPacket = Struct('>LqQ20s4s36sH')
# Bitfield # Bitfield
# pylint: disable=unidiomatic-typecheck
def getBitfield(address): def getBitfield(address):

View File

@ -24,7 +24,7 @@ from addresses import decodeAddress, encodeVarint
from bmconfigparser import BMConfigParser from bmconfigparser import BMConfigParser
from debug import logger from debug import logger
from helper_sql import sqlQuery from helper_sql import sqlQuery
# pylint: disable=logging-format-interpolation
verbose = 1 verbose = 1
# This is obsolete with the change to protocol v3 # This is obsolete with the change to protocol v3

View File

@ -10,6 +10,7 @@ class TestNetworkGroup(unittest.TestCase):
""" """
def test_network_group(self): def test_network_group(self):
"""Test various types of network groups""" """Test various types of network groups"""
# pylint: disable=import-error
from pybitmessage.protocol import network_group from pybitmessage.protocol import network_group
test_ip = '1.2.3.4' test_ip = '1.2.3.4'