From 137a16bbe7a51e8a71f2feede52ce83d96406009 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Tue, 3 Aug 2021 10:47:36 +0000 Subject: [PATCH 1/3] Format code with black This commit fixes the style issues introduced in e9bf7f0 according to the output from black. Details: https://deepsource.icu/gh/karan-deepsource/demo-python/transform/a3f11788-0fa6-4b85-8cb5-799a92d1b660/ --- assignment.py | 7 ++++--- demo_code.py | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/assignment.py b/assignment.py index 271f7cd8d..9db503bc3 100644 --- a/assignment.py +++ b/assignment.py @@ -6,7 +6,8 @@ open("foo") + def foo(foo=None): - if foo is None: - foo = [] - return [*foo] + if foo is None: + foo = [] + return [*foo] diff --git a/demo_code.py b/demo_code.py index db32dd49d..94c1c5bcf 100644 --- a/demo_code.py +++ b/demo_code.py @@ -85,12 +85,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass From 1dc5704628e37a3f35daa4b8df59e0cd6b51c2a4 Mon Sep 17 00:00:00 2001 From: Karan Suthar <68371811+karan-deepsource@users.noreply.github.com> Date: Tue, 3 Aug 2021 16:18:36 +0530 Subject: [PATCH 2/3] Update assignment.py --- assignment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assignment.py b/assignment.py index 9db503bc3..8e4661edb 100644 --- a/assignment.py +++ b/assignment.py @@ -11,3 +11,5 @@ def foo(foo=None): if foo is None: foo = [] return [*foo] + + From 9ddb559fe5c729814faabb70addb7fd7189497c0 Mon Sep 17 00:00:00 2001 From: "enterprise-ds-icu-autofix[bot]" <88178182+enterprise-ds-icu-autofix[bot]@users.noreply.github.com> Date: Tue, 3 Aug 2021 10:48:43 +0000 Subject: [PATCH 3/3] Format code with black --- assignment.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/assignment.py b/assignment.py index 8e4661edb..9db503bc3 100644 --- a/assignment.py +++ b/assignment.py @@ -11,5 +11,3 @@ def foo(foo=None): if foo is None: foo = [] return [*foo] - -