Skip to content

Commit

Permalink
Merge pull request #656 from edreamleo/ekr-use-black-23.1.0
Browse files Browse the repository at this point in the history
PR: Reformat using black 23.1.0
  • Loading branch information
lieryan committed Feb 6, 2023
2 parents 88e2d68 + 7abe394 commit f8a94dd
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion rope/base/oi/doa.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _compat_compare_digest(a, b):
# Computes the bitwise difference of all characters in the two strings
# before returning whether or not they are equal.
difference = 0
for (a_char, b_char) in zip(a, b):
for a_char, b_char in zip(a, b):
difference |= ord(a_char) ^ ord(b_char)
return difference == 0

Expand Down
2 changes: 1 addition & 1 deletion rope/base/oi/runmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def on_function_call(self, frame, event, arg):
returned,
)
self.sender.send_data(data)
except (TypeError):
except TypeError:
pass
return self.on_function_call

Expand Down
5 changes: 0 additions & 5 deletions rope/base/oi/type_hinting/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class SymbolBase:

name = None # node/token type name

def __init__(self):
Expand Down Expand Up @@ -127,7 +126,6 @@ def led(self, left, parser):


class Lexer:

_token_pattern = re.compile(
r"""
\s*
Expand Down Expand Up @@ -179,7 +177,6 @@ def _tokenize_expr(self, program):


class Parser:

token = None
next = None

Expand Down Expand Up @@ -321,7 +318,6 @@ def evaluate(self, pyobject):


class Compiler:

parser_factory = Parser
lexer_factory = Lexer
symbol_table = symbol_table
Expand All @@ -342,7 +338,6 @@ def __call__(self, program):


class Evaluator:

compile = compile

def __call__(self, program, pyobject):
Expand Down
3 changes: 0 additions & 3 deletions rope/base/oi/type_hinting/providers/docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def __call__(self, docstring):


class DocstringParamParser(IParamParser):

DOCSTRING_PARAM_PATTERNS = [
r"\s*:type\s+%s:\s*([^\n]+)", # Sphinx
r"\s*:param\s+(\w+)\s+%s:[^\n]+", # Sphinx param with type
Expand Down Expand Up @@ -144,7 +143,6 @@ def __call__(self, docstring, param_name):


class DocstringReturnParser(IReturnParser):

DOCSTRING_RETURN_PATTERNS = [
re.compile(r"\s*:rtype:\s*([^\n]+)", re.M), # Sphinx
re.compile(r"\s*@rtype:\s*([^\n]+)", re.M), # Epydoc
Expand All @@ -164,7 +162,6 @@ def __call__(self, docstring):


class RSTRoleStrip:

RST_ROLE_PATTERN = re.compile(r":[^`]+:`([^`]+)`")

def __call__(self, type_str):
Expand Down
2 changes: 1 addition & 1 deletion rope/base/oi/type_hinting/resolvers/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ def __call__(self, hint, pyobject):
"""
try:
return evaluate.evaluate(hint, pyobject)
except (Exception):
except Exception:
pass
2 changes: 0 additions & 2 deletions rope/base/oi/type_hinting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


def get_super_func(pyfunc):

if not isinstance(pyfunc.parent, PyClass):
return

Expand Down Expand Up @@ -113,7 +112,6 @@ def resolve_type(type_name, pyobject):


class ParametrizeType:

_supported_mapping = {
"builtins.list": "rope.base.builtins.get_list",
"builtins.tuple": "rope.base.builtins.get_tuple",
Expand Down
1 change: 0 additions & 1 deletion rope/base/pycore.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def analyze_module(
)

def get_classes(self, task_handle=taskhandle.DEFAULT_TASK_HANDLE):

warnings.warn(
"`PyCore.get_classes()` is deprecated", DeprecationWarning, stacklevel=2
)
Expand Down
1 change: 0 additions & 1 deletion rope/base/stdmods.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


def _stdlib_path():

return os.path.dirname(inspect.getsourcefile(inspect))


Expand Down
1 change: 0 additions & 1 deletion rope/contrib/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def create_generate(
offset: int,
goal_resource: Optional[Resource] = None,
):

"""A factory for creating `Generate` objects
Used in https://github.com/python-rope/ropemode but not in Rope itself.
Expand Down
1 change: 0 additions & 1 deletion rope/refactor/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
# There are a few more helper functions and classes used by above
# classes.
class _ExtractRefactoring:

kind_prefixes = {}

def __init__(self, project, resource, start_offset, end_offset, variable=False):
Expand Down
1 change: 0 additions & 1 deletion rope/refactor/importutils/importinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ def is_star_import(self):


class EmptyImport(ImportInfo):

names_and_aliases = []

def is_empty(self):
Expand Down
2 changes: 0 additions & 2 deletions rope/refactor/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ def _calculate_header(self, primary, pyname, call):
return header, to_be_inlined

def _calculate_definition(self, primary, pyname, call, host_vars, returns):

header, to_be_inlined = self._calculate_header(primary, pyname, call)

source = header + self.body
Expand All @@ -454,7 +453,6 @@ def _calculate_definition(self, primary, pyname, call, host_vars, returns):
# If there is a name conflict, all variable names
# inside the inlined function are renamed
if set(all_names).intersection(set(host_vars)):

prefix = next(_DefinitionGenerator.unique_prefix)
guest = libutils.get_string_module(self.project, source, self.resource)

Expand Down

0 comments on commit f8a94dd

Please sign in to comment.