⬆️ pre-commit: upgrade flake8-bugbear & fix issues

This commit is contained in:
Gina Häußge committed 2022-03-23 10:55:12 +01:00
1 parent bf96e6321f
commit 37bc874131
5 files changed
+6 -7

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==22.1.11
- flake8-bugbear==22.3.20
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
+1 -1
View File
@@ -1428,7 +1428,7 @@ class BlueprintPlugin(OctoPrintPlugin, RestartNeedingPlugin):
# we now iterate over all members of ourselves and look if we find an attribute
# that has data originating from one of our decorators - we ignore anything
# starting with a _ to only handle public stuff
for member in [member for member in dir(self) if not member.startswith("_")]:
for member in [x for x in dir(self) if not x.startswith("_")]:
f = getattr(self, member)
if hasattr(f, "_blueprint_rules") and member in f._blueprint_rules:
+1 -2
View File
@@ -41,8 +41,7 @@ class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler):
"""Recursively yield DirEntry objects for given directory."""
for entry in os.scandir(path):
if entry.is_dir(follow_symlinks=False):
for entry in _recursive_scandir(entry.path):
yield entry
yield from _recursive_scandir(entry.path)
else:
yield entry
+2 -2
View File
@@ -150,9 +150,9 @@ def _valid_status_for_cache(status_code):
return 200 <= status_code < 400
def _add_additional_assets(hook):
def _add_additional_assets(hook_name):
result = []
for name, hook in pluginManager.get_hooks(hook).items():
for name, hook in pluginManager.get_hooks(hook_name).items():
try:
assets = hook()
if isinstance(assets, (tuple, list)):
+1 -1
View File
@@ -2593,7 +2593,7 @@ class MachineCom:
)
for key in [
key for key in parsed if key.startswith("e") and len(key) > 1
x for x in parsed if x.startswith("e") and len(x) > 1
]:
setattr(self.last_position, key, parsed.get(key))