Skip to content

Commit

Permalink
error correction
Browse files Browse the repository at this point in the history
  • Loading branch information
DSungatulin committed Feb 20, 2024
1 parent e669ba2 commit 13661e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gendiff/formatters/stylish.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def walk(dict_, output, depth, indent):
else:
output.append(beginning + get_data_format(value))
return (
'{\n' + '\n'.join(output) + f'\n{indent + (INDENT_CHAR*INDENT_NUMBER)[0:-LEFTWARD_SHIFT]}' + '}' #noqa: E226
'{\n' + '\n'.join(output) + f'\n{indent + (INDENT_CHAR*INDENT_NUMBER)[0:-LEFTWARD_SHIFT]}' + '}' # noqa: E226
)

if isinstance(value, dict):
Expand Down Expand Up @@ -46,15 +46,15 @@ def form_string(key, action, old_value, new_value, depth, indent):
def get_stylished(diff):

def walk(diff, output, depth):
indent = ((INDENT_CHAR * INDENT_NUMBER) * depth)[0:-LEFTWARD_SHIFT] #noqa: E226
indent = ((INDENT_CHAR * INDENT_NUMBER) * depth)[0:-LEFTWARD_SHIFT] # noqa: E226
for entry in diff:
key = entry['key']
nested = entry.get('nested')
special_char = ' '
if nested:
output.append(indent + special_char + key + ': {')
walk(nested, output, depth + 1)
output.append(indent + (INDENT_CHAR * INDENT_NUMBER)[0:-LEFTWARD_SHIFT] + '}') #noqa: E226
output.append(indent + (INDENT_CHAR * INDENT_NUMBER)[0:-LEFTWARD_SHIFT] + '}') # noqa: E226
else:
action = entry['action']
old_value = entry['old value']
Expand Down

0 comments on commit 13661e5

Please sign in to comment.