Skip to content

Commit

Permalink
correct code smels
Browse files Browse the repository at this point in the history
  • Loading branch information
DSungatulin committed Feb 23, 2024
1 parent fb3ffed commit 6af616a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions gendiff/formatters/format_determinant.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
def get_data_format_stylish(value):
if isinstance(value, str):
return value
data_format = value
elif value is None:
return 'null'
return str(value).lower()
data_format = 'null'
else:
data_format = str(value).lower()
return data_format


def get_data_format_plain(value):
if isinstance(value, dict):
return '[complex value]'
data_format = '[complex value]'
elif isinstance(value, bool):
return str(value).lower()
data_format = str(value).lower()
elif isinstance(value, str):
return f"'{value}'"
data_format = f"'{value}'"
elif value is None:
return 'null'
return str(value)
data_format = 'null'
else:
data_format = str(value)
return data_format

0 comments on commit 6af616a

Please sign in to comment.