Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format code with black and yapf #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions demo_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ def smethod():
def cmethod(cls, something):
"""class method-to-be"""











cmethod = classmethod(cmethod)


Expand Down Expand Up @@ -90,18 +80,12 @@ 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


Expand Down
5 changes: 4 additions & 1 deletion duplicate_bases_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@


class Base:

def __init__(self):
self.base = 1


class BaseOne:

def __init__(self):
self.base_one = 2

Expand All @@ -15,5 +17,6 @@ class Child(Base, BaseOne, Base, BaseOne):
"""Some Child class"""


class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, abc.ABCMeta):
class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta,
abc.ABCMeta):
"""Class with duplicate bases"""
3 changes: 2 additions & 1 deletion tests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def test_random_number_generator():

if False:
assert "Dead Code!"
print ("Gotcha!")
print("Gotcha!")


def test_partial_code():
"""Some test to check the new metric."""
Expand Down