From b5c253e3213f0e78094385c56a28766e72cdc5a0 Mon Sep 17 00:00:00 2001 From: Vitalis Salis Date: Sun, 26 Nov 2023 10:58:01 +0400 Subject: [PATCH] linter --- pycg/formats/fasten.py | 6 +++--- pycg/machinery/key_err.py | 6 +++--- pycg/pycg.py | 6 +++--- pycg/tests/scopes_test.py | 14 ++++++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pycg/formats/fasten.py b/pycg/formats/fasten.py index 1c84569..5ae6987 100644 --- a/pycg/formats/fasten.py +++ b/pycg/formats/fasten.py @@ -153,9 +153,9 @@ def add_range(begin, end): end = (val, True) add_range(begin, end) - res.append( - {"forge": "PyPI", "product": req.name, "constraints": constraints} - ) + res.append({ + "forge": "PyPI", "product": req.name, "constraints": constraints + }) return res diff --git a/pycg/machinery/key_err.py b/pycg/machinery/key_err.py index 3b1a860..a57caf2 100644 --- a/pycg/machinery/key_err.py +++ b/pycg/machinery/key_err.py @@ -23,9 +23,9 @@ def __init__(self): self.key_errs = [] def add(self, filename, lineno, namespace, key): - self.key_errs.append( - {"filename": filename, "lineno": lineno, "namespace": namespace, "key": key} - ) + self.key_errs.append({ + "filename": filename, "lineno": lineno, "namespace": namespace, "key": key + }) def get(self): return self.key_errs diff --git a/pycg/pycg.py b/pycg/pycg.py index 5453b97..2f77017 100644 --- a/pycg/pycg.py +++ b/pycg/pycg.py @@ -63,9 +63,9 @@ def extract_state(self): state["scopes"] = {} for key, scope in self.scope_manager.get_scopes().items(): - state["scopes"][key] = set( - [x.get_ns() for (_, x) in scope.get_defs().items()] - ) + state["scopes"][key] = set([ + x.get_ns() for (_, x) in scope.get_defs().items() + ]) state["classes"] = {} for key, ch in self.class_manager.get_classes().items(): diff --git a/pycg/tests/scopes_test.py b/pycg/tests/scopes_test.py index c14d67b..cc4af6c 100644 --- a/pycg/tests/scopes_test.py +++ b/pycg/tests/scopes_test.py @@ -62,14 +62,12 @@ def get_lineno(self): self.assertEqual( sorted(items["functions"]), - sorted( - [ - "root.chld1", - "root.chld1.grndchld2", - "root.chld2", - "root.chld3.grndchld4", - ] - ), + sorted([ + "root.chld1", + "root.chld1.grndchld2", + "root.chld2", + "root.chld3.grndchld4", + ]), ) self.assertEqual(sorted(items["classes"]), sorted(["root.chld3"]))