From 402e5e2ce4b4a71da688bbf58cbce87253dfd229 Mon Sep 17 00:00:00 2001 From: Srijan Saurav Date: Mon, 13 Jul 2020 18:45:35 +0530 Subject: [PATCH 1/2] Create prod_final_test.py --- prod_final_test.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 prod_final_test.py diff --git a/prod_final_test.py b/prod_final_test.py new file mode 100644 index 00000000..63ce8f62 --- /dev/null +++ b/prod_final_test.py @@ -0,0 +1,45 @@ +import os +from sys import ( + path as p, + argv +) +import math +# This should be at the top. +from __future__ import print_function +import random as ran + +def foo(this_is_unused, x=[1, 2]): + x.append(ran.randint(1, 100)) + return x + + +def bar(): + print("Hey there, Reviewer!") + + +def spam(): + print("Hope you're paying attention to the tests too!") + + +def give_me_an_issue(): + print(f"okay. Let's fix this unnecessary fstring.") + + +def get_hypotenuse(a, b): + """Fine. Fix this pythagorean issue as well.""" + return math.sqrt(a**2 + b**2) + + +__all__ = [ + "got_hypotenuse", # Shall be deleted + + # Yup. Delete this + + "this_too_would_be_deleted", give_me_an_issue, spam, + foo, "future", bar, + get_hypotenuse, "ughhh", # With a comment, + "budd", + "thudd", + + +] From 4ad40dab7f029f0a8991d93bebea0b00a0cbc184 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2020 13:18:14 +0000 Subject: [PATCH 2/2] Autofix issues in 1 files Resolved issues in the following files via DeepSource Autofix: 1. prod_final_test.py --- prod_final_test.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/prod_final_test.py b/prod_final_test.py index 63ce8f62..5720c761 100644 --- a/prod_final_test.py +++ b/prod_final_test.py @@ -1,14 +1,11 @@ -import os -from sys import ( - path as p, - argv -) -import math # This should be at the top. from __future__ import print_function +import math import random as ran -def foo(this_is_unused, x=[1, 2]): +def foo(this_is_unused, x=None): + if x is None: + x = [1, 2] x.append(ran.randint(1, 100)) return x @@ -22,24 +19,18 @@ def spam(): def give_me_an_issue(): - print(f"okay. Let's fix this unnecessary fstring.") + print("okay. Let's fix this unnecessary fstring.") def get_hypotenuse(a, b): """Fine. Fix this pythagorean issue as well.""" - return math.sqrt(a**2 + b**2) + return math.hypot(a**2 + b**2) __all__ = [ - "got_hypotenuse", # Shall be deleted - - # Yup. Delete this - - "this_too_would_be_deleted", give_me_an_issue, spam, - foo, "future", bar, - get_hypotenuse, "ughhh", # With a comment, - "budd", - "thudd", + "give_me_an_issue", "spam", + "foo", "bar", + "get_hypotenuse" ]