Skip to content

Commit a29d098

Browse files
committed
fix black vs flake8 incompatibility
1 parent 2d90883 commit a29d098

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ exclude =
1212
dist,
1313
src/compas_fab/backends/vrep/remote_api/*,
1414
src/compas_fab/ghpython/path_planning.py
15+
extend-ignore =
16+
# See https://github.com/PyCQA/pycodestyle/issues/373
17+
E203,

tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ def docs(ctx, doctest=False, rebuild=False, check_links=False):
120120
@task()
121121
def lint(ctx):
122122
"""Check the consistency of coding style."""
123-
log.write('Running flake8 python linter...')
124-
125-
with chdir(BASE_FOLDER):
126-
ctx.run('flake8 src')
123+
log.write("Running flake8 python linter...")
124+
ctx.run("flake8 src tests")
125+
log.write("Running black python linter...")
126+
ctx.run("black --check --diff --color src tests")
127127

128128

129129
@task()

tests/backends/ros/messages/test_std_msgs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ def test_posearray():
8686
m = PoseArray(header=Header(), poses=p)
8787
assert (
8888
repr(m)
89-
== "PoseArray(header=Header(seq=0, stamp=Time(secs=0, nsecs=0), frame_id='/world'), poses=[Pose(position=Point(x=0.0, y=0.0, z=0.0), orientation=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0))])"
89+
== "PoseArray(header=Header(seq=0, stamp=Time(secs=0, nsecs=0), frame_id='/world'), "
90+
+ "poses=[Pose(position=Point(x=0.0, y=0.0, z=0.0), orientation=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0))])"
9091
) # noqa E501

tests/robots/test_robot.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,20 @@ def test_inverse_kinematics_repeated_calls_will_return_next_result(ur5_with_fake
298298
configuration = robot.inverse_kinematics(frame, start_config)
299299
assert (
300300
str(configuration)
301-
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), ('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
301+
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), "
302+
+ "('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
302303
)
303304
configuration = robot.inverse_kinematics(frame, start_config)
304305
assert (
305306
str(configuration)
306-
== "Configuration((-2.238, -3.175, 2.174, 4.143, -5.616, -6.283), (0, 0, 0, 0, 0, 0), ('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
307+
== "Configuration((-2.238, -3.175, 2.174, 4.143, -5.616, -6.283), (0, 0, 0, 0, 0, 0), "
308+
+ "('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
307309
)
308310
configuration = robot.inverse_kinematics(frame, start_config)
309311
assert (
310312
str(configuration)
311-
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), ('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
313+
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), "
314+
+ "('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
312315
)
313316

314317

@@ -322,11 +325,13 @@ def test_iter_inverse_kinematics(ur5_with_fake_ik):
322325
assert len(solutions) == 2
323326
assert (
324327
str(solutions[0])
325-
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), ('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
328+
== "Configuration((-1.572, -2.560, 2.196, 2.365, 0.001, 1.137), (0, 0, 0, 0, 0, 0), "
329+
+ "('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
326330
)
327331
assert (
328332
str(solutions[1])
329-
== "Configuration((-2.238, -3.175, 2.174, 4.143, -5.616, -6.283), (0, 0, 0, 0, 0, 0), ('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
333+
== "Configuration((-2.238, -3.175, 2.174, 4.143, -5.616, -6.283), (0, 0, 0, 0, 0, 0), "
334+
+ "('shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'))"
330335
)
331336

332337

0 commit comments

Comments
 (0)