diff --git a/assert_outside_test.py b/assert_outside_test.py index d95f2690..c0f636ad 100644 --- a/assert_outside_test.py +++ b/assert_outside_test.py @@ -1,15 +1,16 @@ # inside a func def def some_function(args): """Docstring.""" - assert 1 > 2, ( - "Some message" - ) + assert ( + 1 > 2 + ), "Some message" if args != []: raise AssertionError + some_function(123) -#Comment +# Comment assert {} is not [] diff --git a/builtin_test.py b/builtin_test.py index 9196b02d..5fe5d7b2 100644 --- a/builtin_test.py +++ b/builtin_test.py @@ -1,14 +1,22 @@ import gettext import locale - -lang = locale.getdefaultlocale()[0] -trans = gettext.translation("qmm", localedir=None, languages=[lang], fallback=True) +lang = ( + locale.getdefaultlocale()[ + 0 + ] +) +trans = gettext.translation( + "qmm", + localedir=None, + languages=[lang], + fallback=True, +) trans.install() print(_("hurray!")) builtinss = dir(__builtins__) -print('_' in builtinss) +print("_" in builtinss) print(__("hurray!")) diff --git a/comparision_with_a_callable.py b/comparision_with_a_callable.py index b9b59760..8fbdf3d2 100644 --- a/comparision_with_a_callable.py +++ b/comparision_with_a_callable.py @@ -9,7 +9,7 @@ def addr(self): @property def another(self): return "ddpjd" - + def not_a_property(self): return "dnvpmPkmv" diff --git a/dangerous_default_arg_test.py b/dangerous_default_arg_test.py index b3e4280b..9667eae5 100644 --- a/dangerous_default_arg_test.py +++ b/dangerous_default_arg_test.py @@ -1,22 +1,46 @@ """Module Docstring.""" + import os -def some_func(arg1, arg2, arg3=[1, 2, 3], arg4=None, arg5={1,2}): +def some_func( + arg1, + arg2, + arg3=[1, 2, 3], + arg4=None, + arg5={1, 2}, +): """ Some docstring to ensure docstring stay at its position """ print("I am a function!") - def some_other_func(arg=[1,2,3]): + def some_other_func( + arg=[1, 2, 3] + ): """Nested function to ensure indentation doesn't get messed up""" - x = [1,2,3]; y={1, 2, 3}; z={'a': 1, 'b': 2}; t=(1, 2, 3) - def another_nested_function(danger_one=x, danger_two=y, danger_three=z, xyz=None, safe_four=t): + x = [1, 2, 3] + y = {1, 2, 3} + z = {"a": 1, "b": 2} + t = (1, 2, 3) + + def another_nested_function( + danger_one=x, + danger_two=y, + danger_three=z, + xyz=None, + safe_four=t, + ): """Another deeply nested function.""" return return arg # Returning - return (arg1, arg2, arg3, arg4) + return ( + arg1, + arg2, + arg3, + arg4, + ) diff --git a/e1120.py b/e1120.py index 0f7b3643..651ba630 100644 --- a/e1120.py +++ b/e1120.py @@ -1,4 +1,5 @@ def func(a, b): return a, b + func(a) diff --git a/len_test.py b/len_test.py index 87ca7f9e..adf0ed2a 100644 --- a/len_test.py +++ b/len_test.py @@ -27,6 +27,9 @@ if len(SEQ3) > 1: print(SEQ3) + def something(): if len(SEQ) > 0: - print("SEQ is greater than 0") + print( + "SEQ is greater than 0" + ) diff --git a/lone_fstring.py b/lone_fstring.py index 92e3f682..381cc41c 100644 --- a/lone_fstring.py +++ b/lone_fstring.py @@ -2,9 +2,9 @@ def _parse_item(self, line): - f"""Parses an md list item line based on the current section type. + f"""Parses an md list item line based on the current section type. Matches expressions of the form `:. For the syntax of see the Rasa docs on NLU training data: {DOCS_BASE_URL}/nlu/training-data-format/#markdown-format""" - pass + pass diff --git a/no_self_use.py b/no_self_use.py index 987e2ccd..035423de 100644 --- a/no_self_use.py +++ b/no_self_use.py @@ -16,10 +16,14 @@ def cl(self): self.p(4321) def xyz(self, p): - def somefunc(self,p): - def anotherfunc(self, p): + def somefunc(self, p): + def anotherfunc( + self, p + ): print(p) + print(p) + print(p) diff --git a/prod_test.py b/prod_test.py index 63ce8f62..13d839c2 100644 --- a/prod_test.py +++ b/prod_test.py @@ -1,45 +1,58 @@ -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 os import random as ran +from sys import argv +from sys import path as p -def foo(this_is_unused, x=[1, 2]): - x.append(ran.randint(1, 100)) + +def foo( + this_is_unused, x=[1, 2] +): + x.append( + ran.randint(1, 100) + ) return x def bar(): - print("Hey there, Reviewer!") + print( + "Hey there, Reviewer!" + ) def spam(): - print("Hope you're paying attention to the tests too!") + print( + "Hope you're paying attention to the tests too!" + ) def give_me_an_issue(): - print(f"okay. Let's fix this unnecessary fstring.") + 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) + 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, + "this_too_would_be_deleted", + give_me_an_issue, + spam, + foo, + "future", + bar, + get_hypotenuse, + "ughhh", # With a comment, "budd", "thudd", - - ] diff --git a/some_test.py b/some_test.py index 52e918ba..181467ab 100644 --- a/some_test.py +++ b/some_test.py @@ -1,9 +1,17 @@ import os + class C: def something(): - print("Hey there!") - + print("Hey there!") + def something_else(self): self.something() - x = list([str(r) for r in range(1, 20)]) + x = list( + [ + str(r) + for r in range( + 1, 20 + ) + ] + ) diff --git a/spaced_file for_mypy.py b/spaced_file for_mypy.py index b9b59760..8fbdf3d2 100644 --- a/spaced_file for_mypy.py +++ b/spaced_file for_mypy.py @@ -9,7 +9,7 @@ def addr(self): @property def another(self): return "ddpjd" - + def not_a_property(self): return "dnvpmPkmv" diff --git a/test_docstring.py b/test_docstring.py index d0c8e65f..77aee9ba 100644 --- a/test_docstring.py +++ b/test_docstring.py @@ -1,12 +1,14 @@ -def has_blankline(target: Optional[str]) -> bool: +def has_blankline( + target: Optional[str], +) -> bool: """Check if redirect is safe, that is using HTTP protocol and is pointing to the same site. - + :param target: redirect target url :type target: str :return: flag signalling whether redirect is safe :rtype: bool """ - + if not target: return False diff --git a/tst_fixer.py b/tst_fixer.py index 343f864b..c835185c 100644 --- a/tst_fixer.py +++ b/tst_fixer.py @@ -17,9 +17,13 @@ def cl(self): def xyz(self, p): def somefunc(self, p): - def anotherfunc(self, p): + def anotherfunc( + self, p + ): print(p) + print(p) + print(p) diff --git a/unnecessary_getattr.py b/unnecessary_getattr.py index fe014356..5f542574 100644 --- a/unnecessary_getattr.py +++ b/unnecessary_getattr.py @@ -1,14 +1,12 @@ import os -c = ( - getattr(os, 'path') # skipcq: PTC-W0034 -) +c = getattr( + os, "path" +) # skipcq: PTC-W0034 # skipcq: PTC-W0034 -c = ( - getattr(os, 'path') -) +c = getattr(os, "path") -c = ( - getattr(os, 'path') -)# skipcq: PTC-W0034 +c = getattr( + os, "path" +) # skipcq: PTC-W0034 diff --git a/unused.py b/unused.py index 974fc89e..b01e8869 100644 --- a/unused.py +++ b/unused.py @@ -3,7 +3,8 @@ def func(x, y, z): - a = 1; b = 2 - c, d = 3, 4 - - return y, a, c + a = 1 + b = 2 + c, d = 3, 4 + + return y, a, c diff --git a/walrus_test.py b/walrus_test.py index 8cc5803d..df8edd7d 100644 --- a/walrus_test.py +++ b/walrus_test.py @@ -1,5 +1,6 @@ def ff(x): return x + if x := ff(2): print(x) diff --git a/wlrs.py b/wlrs.py index 11c343cf..d40d1f54 100644 --- a/wlrs.py +++ b/wlrs.py @@ -2,12 +2,13 @@ import pdb from pdb import set_trace - a = [1, 2, 3, 4] if (n := len(a)) > 3: - print(f"List is too long ({n} elements, expected <= 3)") + print( + f"List is too long ({n} elements, expected <= 3)" + ) + - pdb.set_trace() set_trace() breakpoint() diff --git a/yield_inside_comprehension.py b/yield_inside_comprehension.py index 6fd7b96a..6a1ecb41 100644 --- a/yield_inside_comprehension.py +++ b/yield_inside_comprehension.py @@ -1,3 +1,9 @@ -yum = [(yield x) for x in range(3)] +yum = [ + (yield x) + for x in range(3) +] print(yum) -tum = ((yield x) for x in range(3)) +tum = ( + (yield x) + for x in range(3) +)