Skip to content

Commit

Permalink
blacken
Browse files Browse the repository at this point in the history
  • Loading branch information
bagel897 authored and lieryan committed May 24, 2022
1 parent 73d8db3 commit ea2245f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 18 deletions.
4 changes: 1 addition & 3 deletions rope/base/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,4 @@ class ModuleDecodeError(RopeError):
def __init__(self, filename, message):
self.filename = filename
self.message_ = message
super().__init__(
"Cannot decode file <{}>: {}".format(filename, message)
)
super().__init__("Cannot decode file <{}>: {}".format(filename, message))
4 changes: 1 addition & 3 deletions rope/base/oi/type_hinting/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ def expression(self, rbp=0):

def advance(self, name=None):
if name and self.token.name != name:
raise SyntaxError(
f"Expected {name!r} but found {self.token.name!r}"
)
raise SyntaxError(f"Expected {name!r} but found {self.token.name!r}")
self.token = self.next()


Expand Down
12 changes: 3 additions & 9 deletions rope/base/pyscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ def builtin_names(self):

class ComprehensionScope(Scope):
def __init__(self, pycore, pyobject, visitor):
super().__init__(
pycore, pyobject, pyobject.parent.get_scope()
)
super().__init__(pycore, pyobject, pyobject.parent.get_scope())
self.names = None
self.returned_asts = None
self.defineds = None
Expand Down Expand Up @@ -205,9 +203,7 @@ def get_body_start(self):

class FunctionScope(Scope):
def __init__(self, pycore, pyobject, visitor):
super().__init__(
pycore, pyobject, pyobject.parent.get_scope()
)
super().__init__(pycore, pyobject, pyobject.parent.get_scope())
self.names = None
self.returned_asts = None
self.is_generator = None
Expand Down Expand Up @@ -363,9 +359,7 @@ class TemporaryScope(Scope):
"""

def __init__(self, pycore, parent_scope, names):
super().__init__(
pycore, parent_scope.pyobject, parent_scope
)
super().__init__(pycore, parent_scope.pyobject, parent_scope)
self.names = names

def get_names(self):
Expand Down
1 change: 1 addition & 0 deletions rope/base/utils/pycompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def get_ast_arg_arg(node):
def get_ast_with_items(node):
return node.items


else: # PY2

string_types = (basestring,)
Expand Down
4 changes: 3 additions & 1 deletion rope/contrib/codeassist.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ def get_calltip(self, pyobject, ignore_unknown=False, remove_self=False):
def _get_class_docstring(self, pyclass):
contents = self._trim_docstring(pyclass.get_doc(), 2)
supers = [super.get_name() for super in pyclass.get_superclasses()]
doc = "class {}({}):\n\n".format(pyclass.get_name(), ", ".join(supers)) + contents
doc = (
"class {}({}):\n\n".format(pyclass.get_name(), ", ".join(supers)) + contents
)

if "__init__" in pyclass:
init = pyclass["__init__"].get_object()
Expand Down
4 changes: 3 additions & 1 deletion rope/refactor/functionutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def to_string(self):
if self.args[start:]:
params.extend(self.args[start:])
if self.keywords:
params.extend(["{}={}".format(name, value) for name, value in self.keywords])
params.extend(
["{}={}".format(name, value) for name, value in self.keywords]
)
if self.args_arg is not None:
params.append("*" + self.args_arg)
if self.keywords_arg:
Expand Down
4 changes: 3 additions & 1 deletion rope/refactor/usefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def _make_pattern(self):
if self._is_expression():
replacement = "${%s}" % self._rope_returned
else:
replacement = "{} = ${{{}}}".format(self._rope_result, self._rope_returned)
replacement = "{} = ${{{}}}".format(
self._rope_result, self._rope_returned
)
body = restructure.replace(
body, "return ${%s}" % self._rope_returned, replacement
)
Expand Down

0 comments on commit ea2245f

Please sign in to comment.