ci: bump flake8 to new version
```
./electrum/commands.py:144:9: F824 `global known_commands` is unused: name is never assigned in scope
global known_commands
^
./electrum/commands.py:1916:9: F824 `global known_commands` is unused: name is never assigned in scope
global known_commands
^
./electrum/gui/qt/main_window.py:2405:13: F824 `nonlocal done` is unused: name is never assigned in scope
nonlocal done
^
./electrum/i18n.py:52:5: F824 `global language` is unused: name is never assigned in scope
global language
^
./electrum/plugin.py:189:9: F824 `global _root_permission_cache` is unused: name is never assigned in scope
global _root_permission_cache
^
5 F824 `global known_commands` is unused: name is never assigned in scope
5
```
This commit is contained in:
@@ -151,7 +151,7 @@ task:
|
|||||||
folder: ~/.cache/pip
|
folder: ~/.cache/pip
|
||||||
fingerprint_script: echo Flake8 && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS
|
fingerprint_script: echo Flake8 && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS
|
||||||
install_script:
|
install_script:
|
||||||
- pip install "flake8==7.0.0" "flake8-bugbear==24.1.16"
|
- pip install "flake8==7.2.0" "flake8-bugbear==24.12.12" # flake8-commas
|
||||||
flake8_script:
|
flake8_script:
|
||||||
- flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
|
- flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -141,8 +141,6 @@ class Command:
|
|||||||
|
|
||||||
def command(s):
|
def command(s):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
global known_commands
|
|
||||||
|
|
||||||
if hasattr(func, '__wrapped__'):
|
if hasattr(func, '__wrapped__'):
|
||||||
# plugin command function
|
# plugin command function
|
||||||
name = func.plugin_name + '_' + func.__name__
|
name = func.plugin_name + '_' + func.__name__
|
||||||
@@ -1913,7 +1911,6 @@ def plugin_command(s, plugin_name):
|
|||||||
"""Decorator to register a cli command inside a plugin. To be used within a commands.py file
|
"""Decorator to register a cli command inside a plugin. To be used within a commands.py file
|
||||||
in the plugins root."""
|
in the plugins root."""
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
global known_commands
|
|
||||||
assert len(plugin_name) > 0, "Plugin name must not be empty"
|
assert len(plugin_name) > 0, "Plugin name must not be empty"
|
||||||
func.plugin_name = plugin_name
|
func.plugin_name = plugin_name
|
||||||
name = plugin_name + '_' + func.__name__
|
name = plugin_name + '_' + func.__name__
|
||||||
|
|||||||
@@ -2402,7 +2402,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
|||||||
done = True
|
done = True
|
||||||
|
|
||||||
def on_dialog_closed(*args):
|
def on_dialog_closed(*args):
|
||||||
nonlocal done
|
|
||||||
nonlocal cancelled
|
nonlocal cancelled
|
||||||
if not done:
|
if not done:
|
||||||
cancelled = True
|
cancelled = True
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ language = gettext.translation('electrum', fallback=True, class_=gettext.NullTra
|
|||||||
def _(msg: str, *, context=None) -> str:
|
def _(msg: str, *, context=None) -> str:
|
||||||
if msg == "":
|
if msg == "":
|
||||||
return "" # empty string must not be translated. see #7158
|
return "" # empty string must not be translated. see #7158
|
||||||
global language
|
|
||||||
if context:
|
if context:
|
||||||
contexts = [context]
|
contexts = [context]
|
||||||
if context[-1] != "|": # try with both "|" suffix and without
|
if context[-1] != "|": # try with both "|" suffix and without
|
||||||
|
|||||||
@@ -186,7 +186,6 @@ class Plugins(DaemonThread):
|
|||||||
@profiler(min_threshold=0.5)
|
@profiler(min_threshold=0.5)
|
||||||
def _has_recursive_root_permissions(self, path):
|
def _has_recursive_root_permissions(self, path):
|
||||||
"""Check if a directory and all its subdirectories have root permissions"""
|
"""Check if a directory and all its subdirectories have root permissions"""
|
||||||
global _root_permission_cache
|
|
||||||
if _root_permission_cache.get(path) is not None:
|
if _root_permission_cache.get(path) is not None:
|
||||||
return _root_permission_cache[path]
|
return _root_permission_cache[path]
|
||||||
_root_permission_cache[path] = False
|
_root_permission_cache[path] = False
|
||||||
|
|||||||
Reference in New Issue
Block a user