From 41d920da7233d4de462aedf0a11e38e330d570a3 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 8 Sep 2024 12:32:43 +0200 Subject: [PATCH 1/3] Update .pre-commit-config.yaml Update .pre-commit-config.yaml Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0785bcbac8..1b2f47c553 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -28,7 +28,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 24.8.0 hooks: - id: black From 34169831598005a2887b482061b490ecf09dd392 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 8 Sep 2024 19:24:48 +0200 Subject: [PATCH 2/3] fix code format . . --- .../launch/jupyter_notebook_prototyping.launch.py | 5 ++++- .../launch/motion_planning_pipeline_tutorial.launch.py | 8 ++++++-- .../launch/motion_planning_python_api_tutorial.launch.py | 1 + .../benchmarking/launch/run_benchmarks.launch.py | 4 +++- .../launch/parallel_planning_example.launch.py | 4 +++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py b/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py index 9ab7c386c3..5d162f8414 100644 --- a/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py +++ b/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py @@ -1,6 +1,7 @@ """ A launch file that starts a Jupyter notebook server and nodes that support motion planning with the MoveIt Python library. """ + import os import yaml from launch import LaunchDescription @@ -18,7 +19,9 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available + except ( + EnvironmentError + ): # parent of IOError, OSError *and* WindowsError where available return None diff --git a/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py b/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py index fb0555c384..f5bca3628f 100644 --- a/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py +++ b/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py @@ -13,7 +13,9 @@ def load_file(package_name, file_path): try: with open(absolute_file_path, "r") as file: return file.read() - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available + except ( + EnvironmentError + ): # parent of IOError, OSError *and* WindowsError where available return None @@ -24,7 +26,9 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available + except ( + EnvironmentError + ): # parent of IOError, OSError *and* WindowsError where available return None diff --git a/doc/examples/motion_planning_python_api/launch/motion_planning_python_api_tutorial.launch.py b/doc/examples/motion_planning_python_api/launch/motion_planning_python_api_tutorial.launch.py index 531c8c091b..c7b1be0dd7 100644 --- a/doc/examples/motion_planning_python_api/launch/motion_planning_python_api_tutorial.launch.py +++ b/doc/examples/motion_planning_python_api/launch/motion_planning_python_api_tutorial.launch.py @@ -1,6 +1,7 @@ """ A launch file for running the motion planning python api tutorial """ + import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription diff --git a/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py b/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py index 739b51d1d9..ff7fecc583 100644 --- a/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py +++ b/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py @@ -14,7 +14,9 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available + except ( + EnvironmentError + ): # parent of IOError, OSError *and* WindowsError where available return None diff --git a/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py b/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py index 81ca3d77ff..65bdb9ef64 100644 --- a/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py +++ b/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py @@ -14,7 +14,9 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available + except ( + EnvironmentError + ): # parent of IOError, OSError *and* WindowsError where available return None From 9a80d60fee0783a20e3a30907339fefc5781b22f Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 9 Sep 2024 10:14:13 +0200 Subject: [PATCH 3/3] Improve formatting --- .../launch/jupyter_notebook_prototyping.launch.py | 5 ++--- .../launch/motion_planning_pipeline_tutorial.launch.py | 10 ++++------ .../benchmarking/launch/run_benchmarks.launch.py | 5 ++--- .../launch/parallel_planning_example.launch.py | 5 ++--- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py b/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py index 5d162f8414..8539f11e42 100644 --- a/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py +++ b/doc/examples/jupyter_notebook_prototyping/launch/jupyter_notebook_prototyping.launch.py @@ -19,9 +19,8 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except ( - EnvironmentError - ): # parent of IOError, OSError *and* WindowsError where available + # parent of IOError, OSError *and* WindowsError where available + except EnvironmentError: return None diff --git a/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py b/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py index f5bca3628f..1ae172ebf1 100644 --- a/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py +++ b/doc/examples/motion_planning_pipeline/launch/motion_planning_pipeline_tutorial.launch.py @@ -13,9 +13,8 @@ def load_file(package_name, file_path): try: with open(absolute_file_path, "r") as file: return file.read() - except ( - EnvironmentError - ): # parent of IOError, OSError *and* WindowsError where available + # parent of IOError, OSError *and* WindowsError where available + except EnvironmentError: return None @@ -26,9 +25,8 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except ( - EnvironmentError - ): # parent of IOError, OSError *and* WindowsError where available + # parent of IOError, OSError *and* WindowsError where available + except EnvironmentError: return None diff --git a/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py b/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py index ff7fecc583..79a6b11d43 100644 --- a/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py +++ b/doc/how_to_guides/benchmarking/launch/run_benchmarks.launch.py @@ -14,9 +14,8 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except ( - EnvironmentError - ): # parent of IOError, OSError *and* WindowsError where available + # parent of IOError, OSError *and* WindowsError where available + except EnvironmentError: return None diff --git a/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py b/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py index 65bdb9ef64..9b4178e079 100644 --- a/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py +++ b/doc/how_to_guides/parallel_planning/launch/parallel_planning_example.launch.py @@ -14,9 +14,8 @@ def load_yaml(package_name, file_path): try: with open(absolute_file_path, "r") as file: return yaml.safe_load(file) - except ( - EnvironmentError - ): # parent of IOError, OSError *and* WindowsError where available + # parent of IOError, OSError *and* WindowsError where available + except EnvironmentError: return None