Skip to content

Commit d379983

Browse files
MaxWaterhoutMax WaterhoutJelmerdw
authored
Enforce additional Ruff lint rules and enable docstring checks (#182)
* Add ruff checks to the pyproject.toml Signed-off-by: Max Waterhout <[email protected]> * Add docstrings to rcdt_actions Signed-off-by: Max Waterhout <[email protected]> * add docstrings to rcdt_franka Signed-off-by: Max Waterhout <[email protected]> * Added docstrings to pyflow package Signed-off-by: Max Waterhout <[email protected]> * Added docstrings to rcdt_gazebo Signed-off-by: Max Waterhout <[email protected]> * added docstring to moveit Signed-off-by: Max Waterhout <[email protected]> * added docstring to rcdt_sensors Signed-off-by: Max Waterhout <[email protected]> * Added docstrings to rcdt_joystick Signed-off-by: Max Waterhout <[email protected]> * Added docstrings to rcdt_mobile_manipulator Signed-off-by: Max Waterhout <[email protected]> * added docstrings to rcdt_panther Signed-off-by: Max Waterhout <[email protected]> * Added docstrings to rcdt_utilities Signed-off-by: Max Waterhout <[email protected]> * Added docstring to rcdt_detection Signed-off-by: Max Waterhout <[email protected]> * Update ruff configuration to include DOC in select and remove exclusion for rcdt_detection Signed-off-by: Max Waterhout <[email protected]> * Added preview mode and extra ruff functions to the pyproject.toml Signed-off-by: Max Waterhout <[email protected]> * Add norecursedirs option to pytest configuration Signed-off-by: Max Waterhout <[email protected]> * Ruff format Signed-off-by: Max Waterhout <[email protected]> * Ruff and Ty fixes Signed-off-by: Max Waterhout <[email protected]> * Use Any as type. Signed-off-by: Jelmer de Wolde <[email protected]> --------- Signed-off-by: Max Waterhout <[email protected]> Signed-off-by: Jelmer de Wolde <[email protected]> Co-authored-by: Max Waterhout <[email protected]> Co-authored-by: Jelmer de Wolde <[email protected]>
1 parent eb9c010 commit d379983

File tree

80 files changed

+2595
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2595
-153
lines changed

conftest.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""
6-
Global pytest fixtures for ROS 2 integration testing.
7-
"""
5+
"""Global pytest fixtures for ROS 2 integration testing."""
86

97
from typing import Iterator
108

@@ -15,7 +13,13 @@
1513

1614
@pytest.fixture(scope="module")
1715
def test_node() -> Iterator[Node]:
18-
"""Fixture to create a singleton node for testing."""
16+
"""Fixture to create a singleton node for testing.
17+
18+
This node is used to ensure that the ROS 2 context is initialized and can be used in tests.
19+
20+
Yields:
21+
Node: The singleton node for testing.
22+
"""
1923
rclpy.init()
2024
node = Node("test_node")
2125
yield node
@@ -25,17 +29,36 @@ def test_node() -> Iterator[Node]:
2529

2630
@pytest.fixture(scope="module")
2731
def timeout(pytestconfig: pytest.Config) -> int:
28-
"""Fixture to get the timeout value from pytest config."""
32+
"""Fixture to get the timeout value from pytest config.
33+
34+
Args:
35+
pytestconfig (pytest.Config): The pytest configuration object.
36+
37+
Returns:
38+
int: The timeout value in seconds.
39+
"""
2940
return int(pytestconfig.getini("timeout"))
3041

3142

3243
@pytest.fixture(scope="session")
3344
def finger_joint_fault_tolerance() -> float:
34-
"""Tolerance of testing finger joint movements."""
45+
"""Tolerance of testing finger joint movements.
46+
47+
This is the maximum allowed deviation for finger joint movements during tests.
48+
49+
Returns:
50+
float: The tolerance value for finger joint movements.
51+
"""
3552
return 0.025
3653

3754

3855
@pytest.fixture(scope="session")
3956
def joint_movement_tolerance() -> float:
40-
"""Tolerance of testing joint movements."""
57+
"""Tolerance of testing joint movements.
58+
59+
This is the maximum allowed deviation for joint movements during tests.
60+
61+
Returns:
62+
float: The tolerance value for joint movements.
63+
"""
4164
return 0.01

0 commit comments

Comments
 (0)