Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
vitsalis committed Nov 26, 2023
1 parent 09bf1db commit b5c253e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions pycg/formats/fasten.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions pycg/machinery/key_err.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions pycg/pycg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
14 changes: 6 additions & 8 deletions pycg/tests/scopes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))

Expand Down

0 comments on commit b5c253e

Please sign in to comment.