Skip to content

Commit 35293a1

Browse files
style: format code with Black, ISort and Yapf
This commit fixes the style issues introduced in b99269a according to the output from Black, ISort and Yapf. Details: None
1 parent b99269a commit 35293a1

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

demo_code.py

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import random
2-
import pdb
3-
import sys as sys
1+
import abc
42
import os
3+
import pdb
4+
import random
55
import subprocess
6-
import abc
6+
import sys as sys
77

88
# from django.db.models.expressions import RawSQL
99

@@ -27,16 +27,6 @@ def smethod():
2727
def cmethod(cls, something):
2828
"""class method-to-be"""
2929

30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
4030
cmethod = classmethod(cmethod)
4131

4232

@@ -90,18 +80,12 @@ def tar_something():
9080

9181

9282
def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz):
93-
if (
94-
initial_condition
95-
and (
96-
isinstance(object, int)
97-
or isinstance(object, float)
98-
or isinstance(object, str)
99-
)
100-
and isinstance(other_obj, float)
101-
and isinstance(foo, str)
102-
or (isinstance(bar, float) or isinstance(bar, str))
103-
and (isinstance(baz, float) or isinstance(baz, int))
104-
):
83+
if (initial_condition and
84+
(isinstance(object, int) or isinstance(object, float)
85+
or isinstance(object, str)) and isinstance(other_obj, float)
86+
and isinstance(foo, str)
87+
or (isinstance(bar, float) or isinstance(bar, str)) and
88+
(isinstance(baz, float) or isinstance(baz, int))):
10589
pass
10690

10791

duplicate_bases_class.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33

44
class Base:
5+
56
def __init__(self):
67
self.base = 1
78

89

910
class BaseOne:
11+
1012
def __init__(self):
1113
self.base_one = 2
1214

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

1719

18-
class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, abc.ABCMeta):
20+
class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta,
21+
abc.ABCMeta):
1922
"""Class with duplicate bases"""

tests/test_code.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from demo_code import RandomNumberGenerator
21
import assignment
2+
from demo_code import RandomNumberGenerator
33

44

55
def test_random_number_generator():
@@ -8,7 +8,8 @@ def test_random_number_generator():
88

99
if False:
1010
assert "Dead Code!"
11-
print ("Gotcha!")
11+
print("Gotcha!")
12+
1213

1314
def test_partial_code():
1415
"""Some test to check the new metric."""

0 commit comments

Comments
 (0)