Skip to content

Commit

Permalink
Nacho/fix flake8 remaining tests (ros-navigation#3942)
Browse files Browse the repository at this point in the history
* Use ament_black as linter

* Fix standard flake8 errors for `tools

- F401 'ament_index_python.packages.get_package_share_directory' imported but unused

* Fix flake8 tests for nav2_common

- nav2_common/nav2_common/launch/__init__.py:15:1: F401 '.has_node_params.HasNodeParams' imported but unused
- nav2_common/nav2_common/launch/__init__.py:16:1: F401 '.rewritten_yaml.RewrittenYaml' imported but unused
- nav2_common/nav2_common/launch/__init__.py:17:1: F401 '.replace_string.ReplaceString' imported but unused
- nav2_common/nav2_common/launch/__init__.py:18:1: F401 '.parse_multirobot_pose.ParseMultiRobotPose' imported but unused

* Fix flake8 nav2_common linterr

- nav2_common/nav2_common/launch/replace_string.py:97:100: E501 line too long (108 > 99 characters)

* Fix flake8 nav2_common linter

- nav2_common/nav2_common/launch/rewritten_yaml.py:142:16: E713 test for membership should be 'not in'

* Fix flake8 nav_common linter

-  nav2_common/nav2_common/launch/has_node_params.py:21:1: F401 'sys' imported but unused

* Fix nav2_system_tests flake8 linter

This came after using black as formatter. So respecting the previous
code

* Fix flake8-builtins linter

* Fix flake8-comprehensions linter

* Fix flake8-import-order linter for nav2_sumple_commander

* Fix flake8-import-order linter for nav2_system_tests

* Fix flake8-import-order linter for nav2_common

* Fix flake8-import-order linter for tools

* Fix flake8-docstring linter

* Fix flake8-quotes linter for nav2_common

* Fix flake8-quotes linter for nav2_system_tests

* Fix flake8-quotes linter for nav2_collision_monitor

* Fix flake8-quotes linter for nav2_map_server

* Fix flake8-quotes linter for nav2_bringup

* Fix flake8-quotes linter for tools

* Fix flake8-quotes linter for nav2_simple_commander

* Fix flake8-quotes linter for nav2_lifecycle

* Fix flake8-quotes linter for nav2_costmap2d

* Fix flake8-quotes linter for nav2_smac_planner

* Fix linter... again
  • Loading branch information
nachovizzo authored and Marc-Morcos committed Jul 4, 2024
1 parent 6089e3a commit b557af3
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def generate_launch_description():
params_file = ReplaceString(
source_file=params_file,
replacements={'<robot_namespace>': ('/', namespace)},
condition=IfCondition(use_namespace))
condition=IfCondition(use_namespace),
)

configured_params = ParameterFile(
RewrittenYaml(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class TaskResult(Enum):


class BasicNavigator(Node):

def __init__(self, node_name='basic_navigator', namespace=''):
super().__init__(node_name=node_name, namespace=namespace)
self.initial_pose = PoseStamped()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


class TestFootprintCollisionChecker(unittest.TestCase):

def test_no_costmap(self):
# Test if a type error raised when costmap is not specified yet
fcc_ = FootprintCollisionChecker()
Expand Down
1 change: 0 additions & 1 deletion nav2_simple_commander/test/test_line_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class TestLineIterator(unittest.TestCase):

def test_type_error(self):
# Test if a type error raised when passing invalid arguements types
self.assertRaises(TypeError, LineIterator, 0, 0, '10', 10, '1')
Expand Down
1 change: 0 additions & 1 deletion nav2_system_tests/src/system/nav_to_pose_tester_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@


class NavTester(Node):

def __init__(self, initial_pose: Pose, goal_pose: Pose, namespace: str = ''):
super().__init__(node_name='nav2_tester', namespace=namespace)
self.initial_pose_pub = self.create_publisher(
Expand Down
1 change: 0 additions & 1 deletion nav2_system_tests/src/waypoint_follower/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@


class WaypointFollowerTest(Node):

def __init__(self):
super().__init__(node_name='nav2_waypoint_tester', namespace='')
self.waypoints = None
Expand Down

0 comments on commit b557af3

Please sign in to comment.