Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed linting errors in Dashing #290

Merged
merged 2 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rclcpp/minimal_action_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ ament_target_dependencies(action_client_not_composable_with_feedback
"rclcpp_action"
"example_interfaces")

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(TARGETS
action_client_member_functions
action_client_not_composable
Expand Down
4 changes: 3 additions & 1 deletion rclcpp/minimal_action_client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
<depend>rclcpp</depend>
<depend>rclcpp_action</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

5 changes: 5 additions & 0 deletions rclcpp/minimal_action_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ ament_target_dependencies(action_server_not_composable
"rclcpp_action"
"example_interfaces")

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(TARGETS
action_server_not_composable
action_server_member_functions
Expand Down
4 changes: 3 additions & 1 deletion rclcpp/minimal_action_server/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
<depend>rclcpp</depend>
<depend>rclcpp_action</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

5 changes: 5 additions & 0 deletions rclcpp/minimal_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ ament_target_dependencies(client_main rclcpp example_interfaces)
install(TARGETS client_main
DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 3 additions & 1 deletion rclcpp/minimal_client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<exec_depend>rclcpp</exec_depend>
<exec_depend>example_interfaces</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

8 changes: 6 additions & 2 deletions rclcpp/minimal_composition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ ament_target_dependencies(composition_nodes rclcpp rclcpp_components std_msgs)
# Export the library path to ensure that the installed libraries are available.
if(NOT WIN32)
ament_environment_hooks(
"${ament_cmake_package_templates_ENVIRONMENT_HOOK_LIBRARY_PATH}"
)
"${ament_cmake_package_templates_ENVIRONMENT_HOOK_LIBRARY_PATH}")
endif()

add_executable(composition_publisher src/standalone_publisher.cpp)
Expand Down Expand Up @@ -58,4 +57,9 @@ install(TARGETS
composition_composed
DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
3 changes: 3 additions & 0 deletions rclcpp/minimal_composition/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<exec_depend>rclcpp_components</exec_depend>
<exec_depend>std_msgs</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
5 changes: 5 additions & 0 deletions rclcpp/minimal_publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ install(TARGETS
DESTINATION lib/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 3 additions & 1 deletion rclcpp/minimal_publisher/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<exec_depend>rclcpp</exec_depend>
<exec_depend>std_msgs</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

5 changes: 5 additions & 0 deletions rclcpp/minimal_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ ament_target_dependencies(service_main rclcpp example_interfaces)
install(TARGETS service_main
DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 3 additions & 1 deletion rclcpp/minimal_service/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<exec_depend>rclcpp</exec_depend>
<exec_depend>example_interfaces</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

5 changes: 5 additions & 0 deletions rclcpp/minimal_subscriber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ install(TARGETS
subscriber_not_composable
DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 3 additions & 1 deletion rclcpp/minimal_subscriber/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<exec_depend>rclcpp</exec_depend>
<exec_depend>std_msgs</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

5 changes: 5 additions & 0 deletions rclcpp/minimal_timer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ install(TARGETS
DESTINATION lib/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 3 additions & 1 deletion rclcpp/minimal_timer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

<exec_depend>rclcpp</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from action_msgs.msg import GoalStatus
from example_interfaces.action import Fibonacci

import rclpy
from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.node import Node
from rclpy.timer import WallTimer


class MinimalActionClient(Node):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import rclpy
from rclpy.action import ActionClient
from rclpy.node import Node


def feedback_cb(logger, feedback):
Expand Down
24 changes: 24 additions & 0 deletions rclpy/actions/minimal_action_client/test/test_copyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest


@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
# Test is called from package root
rc = main(argv=['.'])
assert rc == 0, 'Found errors'
24 changes: 24 additions & 0 deletions rclpy/actions/minimal_action_client/test/test_flake8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main
import pytest


@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
# Test is called from package root
rc = main(argv=['.'])
assert rc == 0, 'Found errors'
24 changes: 24 additions & 0 deletions rclpy/actions/minimal_action_client/test/test_pep257.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest


@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
# Test is called from package root
rc = main(argv=['.'])
assert rc == 0, 'Found code style errors / warnings'
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ def destroy(self):
super().destroy_node()

def goal_callback(self, goal_request):
"""Accepts or rejects a client request to begin an action."""
"""Accept or reject a client request to begin an action."""
# This server allows multiple goals in parallel
self.get_logger().info('Received goal request')
return GoalResponse.ACCEPT

def cancel_callback(self, goal_handle):
"""Accepts or rejects a client request to cancel an action."""
"""Accept or reject a client request to cancel an action."""
self.get_logger().info('Received cancel request')
return CancelResponse.ACCEPT

async def execute_callback(self, goal_handle):
"""Executes a goal."""
"""Execute a goal."""
self.get_logger().info('Executing goal...')

# Append the seeds for the Fibonacci sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ def destroy(self):
super().destroy_node()

def goal_callback(self, goal_request):
"""Accepts or rejects a client request to begin an action."""
"""Accept or reject a client request to begin an action."""
self.get_logger().info('Received goal request')
return GoalResponse.ACCEPT

def handle_accepted_callback(self, goal_handle):
"""Provides a handle to an accepted goal."""
"""Provide a handle to an accepted goal."""
self.get_logger().info('Deferring execution...')
self._goal_handle = goal_handle
self._timer = self.create_timer(3.0, self.timer_callback)

def cancel_callback(self, goal_handle):
"""Accepts or rejects a client request to cancel an action."""
"""Accept or reject a client request to cancel an action."""
self.get_logger().info('Received cancel request')
return CancelResponse.ACCEPT

Expand All @@ -67,7 +67,7 @@ def timer_callback(self):
self._timer.cancel()

async def execute_callback(self, goal_handle):
"""Executes a goal."""
"""Execute a goal."""
self.get_logger().info('Executing goal...')

# Append the seeds for the Fibonacci sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from rclpy.action import ActionServer, CancelResponse
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import MultiThreadedExecutor
from rclpy.node import Node


logger = None
Expand All @@ -32,7 +31,7 @@ def cancel_callback(goal_handle):


async def execute_callback(goal_handle):
"""Executes the goal."""
"""Execute the goal."""
logger.info('Executing goal...')

# Append the seeds for the fibonacci sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def destroy(self):
super().destroy_node()

def goal_callback(self, goal_request):
"""Accepts or rejects a client request to begin an action."""
"""Accept or reject a client request to begin an action."""
self.get_logger().info('Received goal request')
return GoalResponse.ACCEPT

def cancel_callback(self, goal_handle):
"""Accepts or rejects a client request to cancel an action."""
"""Accept or reject a client request to cancel an action."""
self.get_logger().info('Received cancel request')
return CancelResponse.ACCEPT

def execute_callback(self, goal_handle):
"""Executes a goal."""
"""Execute a goal."""
self.get_logger().info('Executing goal...')

# Append the seeds for the Fibonacci sequence
Expand Down
Loading