From be5493e5b24f68dd3a4283ce73f83b8e372c5902 Mon Sep 17 00:00:00 2001 From: Alexander Fischer Date: Tue, 14 Sep 2021 12:48:59 +0200 Subject: [PATCH] Better comment --- pre_commit_hooks/pretty_format_json.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre_commit_hooks/pretty_format_json.py b/pre_commit_hooks/pretty_format_json.py index 790d151..adcd12e 100644 --- a/pre_commit_hooks/pretty_format_json.py +++ b/pre_commit_hooks/pretty_format_json.py @@ -48,8 +48,8 @@ def _get_pretty_format( ): # No sorting requested # Value is no list, sorting makes no sense - # Only sort if all list entries are of the same type - # Only sort if all list entries are no list or mapping + # Not all list entries are of the same type + # One or more list entries are list or mapping transformed_pairs.append((key, value)) continue transformed_pairs.append((key, sorted(value))) @@ -71,8 +71,8 @@ def _get_pretty_format( ): # No unification requested # Value is no list, unification makes no sense - # Only unify if all list entries are of the same type - # Only unify if all list entries are no list or mapping + # Not all list entries are of the same type + # One or more list entries are list or mapping transformed_pairs.append((key, value)) continue transformed_pairs.append((key, list(dict.fromkeys(value))))