Skip to content

Commit

Permalink
Use imperative mood in constructor docstrings. (ros2#103)
Browse files Browse the repository at this point in the history
* Use imperative mood in constructor docstrings.

Fixes D401 in pycodestyle 5.0.0 and flake8.

Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>

* Use imperative mood in docstring.

Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>

* Use imperative mood in docstrings.

Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>
  • Loading branch information
nuclearsandwich committed Dec 10, 2019
1 parent b2e2a01 commit d6dd5c0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion launch_ros/examples/lifecycle_pub_sub_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def main(argv=sys.argv[1:]):
"""Main."""
"""Run lifecycle nodes via launch."""
ld = launch.LaunchDescription()

# Prepare the talker node.
Expand Down
2 changes: 1 addition & 1 deletion launch_ros/examples/pub_sub_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def main(argv=sys.argv[1:]):
"""Main."""
"""Run demo nodes via launch."""
ld = LaunchDescription([
launch_ros.actions.Node(
package='demo_nodes_cpp', node_executable='talker', output='screen',
Expand Down
2 changes: 1 addition & 1 deletion launch_ros/launch_ros/actions/push_ros_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
namespace: SomeSubstitutionsType,
**kwargs
) -> None:
"""Constructor."""
"""Create a PushRosNamespace action."""
super().__init__(**kwargs)
self.__namespace = normalize_to_list_of_substitutions(namespace)

Expand Down
2 changes: 1 addition & 1 deletion launch_ros/launch_ros/default_launch_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ROSSpecificLaunchStartup(launch.actions.OpaqueFunction):
"""Does ROS specific launch startup."""

def __init__(self, rclpy_context=None):
"""Constructor."""
"""Create a ROSSpecificLaunchStartup opaque function."""
super().__init__(function=self._function)
self.__shutting_down = False
self.__rclpy_context = rclpy_context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
**kwargs
) -> None:
"""
Constructor.
Create an OnStateTransition event handler.
There are several matching options, each of which is compared with the
event and must match it to have the handler handle the event.
Expand Down
2 changes: 1 addition & 1 deletion launch_ros/launch_ros/events/lifecycle/change_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
transition_id: int
) -> None:
"""
Constructor.
Create a ChangeState event.
:param: lifecycle_node_matcher is a callable which returns True if the
given lifecycle node should be affected by this event.
Expand Down
2 changes: 1 addition & 1 deletion launch_ros/launch_ros/events/lifecycle/state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
msg: lifecycle_msgs.msg.TransitionEvent
) -> None:
"""
Constructor.
Create a StateTransition event.
:param: action the instance of class::`LifecycleNode` that generated this event
:param: msg the instance of the ROS message TransitionEvent that generated this event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ExecutableInPackage(FindPackagePrefix):
"""

def __init__(self, executable: SomeSubstitutionsType, package: SomeSubstitutionsType) -> None:
"""Constructor."""
"""Create an ExecutableInPackage substitution."""
super().__init__(package)
self.__executable = normalize_to_list_of_substitutions(executable)

Expand Down
2 changes: 1 addition & 1 deletion launch_ros/launch_ros/substitutions/find_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(
self,
package: SomeSubstitutionsType,
) -> None:
"""Constructor."""
"""Create a FindPackage substitution."""
super().__init__()
self.__package = normalize_to_list_of_substitutions(package)

Expand Down
4 changes: 2 additions & 2 deletions ros2launch/ros2launch/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MultipleLaunchFilesError(Exception):
"""Exception raised when multiple candidate launch files are found in a package."""

def __init__(self, msg, paths):
"""Constructor."""
"""Create a MultipleLaunchFilesError."""
super().__init__(msg)
self.paths = paths

Expand Down Expand Up @@ -168,7 +168,7 @@ class LaunchFileNameCompleter:
"""Callable returning a list of launch file names within a package's share directory."""

def __init__(self, *, package_name_key=None):
"""Constructor."""
"""Create LaunchFileNameCompleter."""
self.package_name_key = 'package_name' if package_name_key is None else package_name_key

def __call__(self, prefix, parsed_args, **kwargs):
Expand Down

0 comments on commit d6dd5c0

Please sign in to comment.