From ba5bf0d06d0721a323219f4324fb9319206ec67c Mon Sep 17 00:00:00 2001 From: Leander Stephen D'Souza Date: Wed, 2 Apr 2025 22:44:41 +0000 Subject: [PATCH 1/2] Configured mypy to run on the costmap_2d package. Signed-off-by: Leander Stephen D'Souza --- nav2_costmap_2d/test/integration/costmap_tests_launch.py | 4 ++-- .../test/test_launch_files/costmap_map_server.launch.py | 2 +- tools/pyproject.toml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nav2_costmap_2d/test/integration/costmap_tests_launch.py b/nav2_costmap_2d/test/integration/costmap_tests_launch.py index 5980f8f699b..d1bec18587f 100755 --- a/nav2_costmap_2d/test/integration/costmap_tests_launch.py +++ b/nav2_costmap_2d/test/integration/costmap_tests_launch.py @@ -24,9 +24,9 @@ from launch_testing.legacy import LaunchTestService -def main(argv=sys.argv[1:]): +def main(argv: list[str] = sys.argv[1:]) -> LaunchTestService: launchFile = os.path.join( - os.getenv('TEST_LAUNCH_DIR'), 'costmap_map_server.launch.py' + os.getenv('TEST_LAUNCH_DIR', ''), 'costmap_map_server.launch.py' ) testExecutable = os.getenv('TEST_EXECUTABLE') diff --git a/nav2_costmap_2d/test/test_launch_files/costmap_map_server.launch.py b/nav2_costmap_2d/test/test_launch_files/costmap_map_server.launch.py index 622d55e0745..b3ff9b09beb 100644 --- a/nav2_costmap_2d/test/test_launch_files/costmap_map_server.launch.py +++ b/nav2_costmap_2d/test/test_launch_files/costmap_map_server.launch.py @@ -20,7 +20,7 @@ import launch_ros.actions -def generate_launch_description(): +def generate_launch_description() -> LaunchDescription: mapFile = os.getenv('TEST_MAP') return LaunchDescription( [ diff --git a/tools/pyproject.toml b/tools/pyproject.toml index c1ff5ba55a7..08693d6a353 100644 --- a/tools/pyproject.toml +++ b/tools/pyproject.toml @@ -24,6 +24,7 @@ module = [ "launch.*", "ament_index_python.*", "nav2_common.*", + "launch_testing.*", ] ignore_missing_imports = true From 184dbe4dc65db320f9e414f3e66e0324b792035f Mon Sep 17 00:00:00 2001 From: Leander Stephen D'Souza Date: Wed, 2 Apr 2025 22:45:50 +0000 Subject: [PATCH 2/2] Added mypy_nav2_costmap_2d to the workflow. Signed-off-by: Leander Stephen D'Souza --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 482126c41b3..dafec791147 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,7 @@ jobs: - "nav2_common" - "nav2_bringup" - "nav2_collision_monitor" + - "nav2_costmap_2d" steps: - uses: actions/checkout@v4