ci: enable more flake8 stuff
```
$ export ELECTRUM_LINTERS=E9,E101,E129,E273,E274,E703,E71,E722,F5,F6,F7,F8,W191,W29,B
$ export ELECTRUM_LINTERS_IGNORE=B007,B009,B010,B019,B036,F541,F841
$ flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
./electrum/commands.py:98:1: F811 redefinition of unused 'format_satoshis' from line 48
def format_satoshis(x):
^
./electrum/commands.py:437:9: F811 redefinition of unused 'Mnemonic' from line 62
from .mnemonic import Mnemonic
^
./electrum/gui/qt/wizard/wallet.py:37:5: F811 redefinition of unused 'Daemon' from line 14
from electrum.daemon import Daemon
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'Optional' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'TYPE_CHECKING' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/plugin.py:966:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/plugin.py:1040:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/util.py:44:1: F811 redefinition of unused 'json' from line 26
import json
^
./electrum/util.py:46:1: F811 redefinition of unused 'NamedTuple' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:46:1: F811 redefinition of unused 'Optional' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:1456:56: F811 redefinition of unused 'traceback' from line 34
async def __aexit__(self, exc_type, exc_value, traceback):
^
./electrum/wallet_db.py:536:9: F811 redefinition of unused 'LOCAL' from line 46
LOCAL = 1
^
./electrum/wallet_db.py:537:9: F811 redefinition of unused 'REMOTE' from line 46
REMOTE = -1
^
./tests/test_bitcoin.py:28:1: F811 redefinition of unused 'bitcoin' from line 9
from electrum import crypto, constants, bitcoin
^
./tests/test_txbatcher.py:11:1: F811 redefinition of unused 'Transaction' from line 7
from electrum.transaction import Transaction, PartialTxInput, PartialTxOutput, TxOutpoint
^
./tests/test_wallet_vertical.py:20:1: F811 redefinition of unused 'Transaction' from line 10
from electrum.transaction import Transaction, PartialTxOutput, tx_from_any, Sighash
^
16 F811 redefinition of unused 'format_satoshis' from line 48
16
```
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
import binascii
|
||||
import concurrent.futures
|
||||
import logging
|
||||
import os, sys, re, json
|
||||
import os, sys, re
|
||||
from collections import defaultdict, OrderedDict
|
||||
from concurrent.futures.process import ProcessPoolExecutor
|
||||
from typing import (NamedTuple, Union, TYPE_CHECKING, Tuple, Optional, Callable, Any,
|
||||
@@ -31,7 +31,6 @@ from typing import (NamedTuple, Union, TYPE_CHECKING, Tuple, Optional, Callable,
|
||||
from datetime import datetime, timezone
|
||||
import decimal
|
||||
from decimal import Decimal
|
||||
import traceback
|
||||
import urllib
|
||||
import threading
|
||||
import hmac
|
||||
@@ -43,7 +42,6 @@ import urllib.request, urllib.parse, urllib.error
|
||||
import builtins
|
||||
import json
|
||||
import time
|
||||
from typing import NamedTuple, Optional
|
||||
import ssl
|
||||
import ipaddress
|
||||
from ipaddress import IPv4Address, IPv6Address
|
||||
@@ -1453,9 +1451,9 @@ if hasattr(asyncio, 'timeout'): # python 3.11+
|
||||
async_timeout = asyncio.timeout
|
||||
else:
|
||||
class TimeoutAfterAsynciolike(aiorpcx.curio.TimeoutAfter):
|
||||
async def __aexit__(self, exc_type, exc_value, traceback):
|
||||
async def __aexit__(self, exc_type, exc_value, tb):
|
||||
try:
|
||||
await super().__aexit__(exc_type, exc_value, traceback)
|
||||
await super().__aexit__(exc_type, exc_value, tb)
|
||||
except (aiorpcx.TaskTimeout, aiorpcx.UncaughtTimeoutError):
|
||||
raise asyncio.TimeoutError from None
|
||||
except aiorpcx.TimeoutCancellationError:
|
||||
|
||||
Reference in New Issue
Block a user