diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0664b224..a71dc9ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,10 +32,10 @@ repos: files: ^.github|./\.yaml - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.10.1 hooks: - id: black - args: ["--line-length=99"] + args: ["--line-length=99", "--experimental-string-processing"] - repo: https://github.com/PyCQA/flake8 rev: 6.1.0 diff --git a/rosbot_xl_bringup/launch/bringup.launch.py b/rosbot_xl_bringup/launch/bringup.launch.py index 2bf5d487..08b7d3a8 100644 --- a/rosbot_xl_bringup/launch/bringup.launch.py +++ b/rosbot_xl_bringup/launch/bringup.launch.py @@ -30,7 +30,9 @@ def generate_launch_description(): declare_mecanum_arg = DeclareLaunchArgument( "mecanum", default_value="False", - description="Whether to use mecanum drive controller (otherwise diff drive controller is used)", + description=( + "Whether to use mecanum drive controller (otherwise diff drive controller is used)" + ), ) lidar_model = LaunchConfiguration("lidar_model") diff --git a/rosbot_xl_controller/setup.cfg b/rosbot_xl_controller/setup.cfg index 8c47b3f2..8878b79a 100644 --- a/rosbot_xl_controller/setup.cfg +++ b/rosbot_xl_controller/setup.cfg @@ -2,6 +2,3 @@ script_dir=$base/lib/rosbot_xl_controller [install] install_scripts=$base/lib/rosbot_xl_controller -[flake8] -ignore = E501,W503 # Ignore "line too long" (E501) and "line break before binary operator" (W503) - black checks it -max-line-length = 99 diff --git a/rosbot_xl_controller/test/test_diff_drive_controllers.py b/rosbot_xl_controller/test/test_diff_drive_controllers.py index 52e50663..f7d12ecc 100644 --- a/rosbot_xl_controller/test/test_diff_drive_controllers.py +++ b/rosbot_xl_controller/test/test_diff_drive_controllers.py @@ -58,17 +58,20 @@ def test_controllers_startup_fail(): node.start_node_thread() msgs_received_flag = node.joint_state_msg_event.wait(timeout=10.0) - assert ( - not msgs_received_flag - ), "Received JointStates message that should not have appeared. Check whether other robots are connected to your network.!" + assert not msgs_received_flag, ( + "Received JointStates message that should not have appeared. Check whether other" + " robots are connected to your network.!" + ) msgs_received_flag = node.odom_msg_event.wait(timeout=10.0) - assert ( - not msgs_received_flag - ), "Received Odom message that should not have appeared. Check whether other robots are connected to your network.!" + assert not msgs_received_flag, ( + "Received Odom message that should not have appeared. Check whether other robots are" + " connected to your network.!" + ) msgs_received_flag = node.imu_msg_event.wait(timeout=10.0) - assert ( - not msgs_received_flag - ), "Received Imu message that should not have appeared. Check whether other robots are connected to your network.!" + assert not msgs_received_flag, ( + "Received Imu message that should not have appeared. Check whether other robots are" + " connected to your network.!" + ) finally: rclpy.shutdown() diff --git a/rosbot_xl_controller/test/test_mecanum_controllers.py b/rosbot_xl_controller/test/test_mecanum_controllers.py index 484dd564..2b8a1567 100644 --- a/rosbot_xl_controller/test/test_mecanum_controllers.py +++ b/rosbot_xl_controller/test/test_mecanum_controllers.py @@ -58,15 +58,20 @@ def test_controllers_startup_fail(): node.start_node_thread() msgs_received_flag = node.joint_state_msg_event.wait(timeout=10.0) - assert ( - not msgs_received_flag - ), "Expected JointStates message not received. Check joint_state_broadcaster!" + assert not msgs_received_flag, ( + "Received JointStates message that should not have appeared. Check whether other" + " robots are connected to your network.! aaaaaaaaaaaaaaaaaaaaaaaaaaa" + ) msgs_received_flag = node.odom_msg_event.wait(timeout=10.0) - assert ( - not msgs_received_flag - ), "Expected Odom message not received. Check rosbot_base_controller!" + assert not msgs_received_flag, ( + "Received Odom message that should not have appeared. Check whether other robots are" + " connected to your network.!" + ) msgs_received_flag = node.imu_msg_event.wait(timeout=10.0) - assert not msgs_received_flag, "Expected Imu message not received. Check imu_broadcaster!" + assert not msgs_received_flag, ( + "Received Imu message that should not have appeared. Check whether other robots are" + " connected to your network.!" + ) finally: rclpy.shutdown() diff --git a/rosbot_xl_gazebo/launch/simulation.launch.py b/rosbot_xl_gazebo/launch/simulation.launch.py index c4906b1b..2a57c2a0 100644 --- a/rosbot_xl_gazebo/launch/simulation.launch.py +++ b/rosbot_xl_gazebo/launch/simulation.launch.py @@ -33,7 +33,9 @@ def generate_launch_description(): declare_mecanum_arg = DeclareLaunchArgument( "mecanum", default_value="False", - description="Whether to use mecanum drive controller (otherwise diff drive controller is used)", + description=( + "Whether to use mecanum drive controller (otherwise diff drive controller is used)" + ), ) lidar_model = LaunchConfiguration("lidar_model")