Skip to content
This repository was archived by the owner on Aug 31, 2020. It is now read-only.

Commit 144e63b

Browse files
committed
Docstring formatting fixes
1 parent 549d50a commit 144e63b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

ros1_fuzzer/ros_commons.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def ros_type_to_dict(msg_type):
1818
Create a dictionary which values say if the ROS message type is complex (not basic), which is its parent
1919
ROS message module, its type, if it is an array and if so, its size.
2020
21-
:param msg_type: ROS message type
21+
:param msg_type: ROS message type.
2222
:return: A dictionary which values say if the ROS message type is complex (not basic), which is its parent
23-
ROS message module, its type, if it is an array and if so, its size
23+
ROS message module, its type, if it is an array and if so, its size.
2424
"""
2525
type_regexp = re.compile(
2626
r'^(?P<complex>(?P<module>[\w]+)/)?(?P<type>[\w]+)(?P<array>\[(?P<array_size>[0-9]*)?\])?$')
@@ -36,7 +36,7 @@ def ros_msg_loader(type_dict):
3636
Dynamically import ROS message modules.
3737
3838
:param type_dict: A dictionary which values say if the ROS message type is complex (not basic), which is its parent
39-
ROS message module, its type, if it is an array and if so, its size
39+
ROS message module, its type, if it is an array and if so, its size.
4040
:return: The ROS message class. If the provided type does not exist, raises an import error.
4141
"""
4242
try:
@@ -53,10 +53,10 @@ def ros_msg_loader(type_dict):
5353

5454
def ros_msg_loader_str(msg_type):
5555
"""
56-
Wrapper for the :func:`ros_msg_loader` to treat string type command line arguments
56+
Wrapper for the :func:`ros_msg_loader` to treat string type command line arguments.
5757
58-
:param msg_type: A string type ROS message type (e.g. "Log")
59-
:return: The :func:`ros_msg_loader` function
58+
:param msg_type: A string type ROS message type (e.g. "Log").
59+
:return: The :func:`ros_msg_loader` function.
6060
"""
6161
type_dict = ros_type_to_dict(msg_type)
6262
if type_dict:
@@ -70,8 +70,8 @@ def create_publisher(topic, msg_type):
7070
Create an instance of a ROS publisher object an initialize it.
7171
7272
:param topic: The ROS topic that the publisher object is going to write in.
73-
:param msg_type: ROS message type (e.g. Log)
74-
:return: The newly created publisher object
73+
:param msg_type: ROS message type (e.g. Log).
74+
:return: The newly created publisher object.
7575
"""
7676
pub = rospy.Publisher(topic, msg_type, queue_size=10)
7777
rospy.init_node('fuzzer_node', anonymous=False)
@@ -82,8 +82,8 @@ def map_ros_types(ros_class):
8282
"""
8383
A recursive function that maps ROS message fields to Hypothesis strategies.
8484
85-
:param ros_class: The ROS class to be fuzzed
86-
:return: A function that generates Hypothesis strategies for a given ROS message type
85+
:param ros_class: The ROS class to be fuzzed.
86+
:return: A function that generates Hypothesis strategies for a given ROS message type.
8787
"""
8888
strategy_dict = {}
8989
slot_names = ros_class.__slots__
@@ -112,10 +112,10 @@ def parse_basic_arrays(s_name, type_dict, strategy_dict):
112112
"""
113113
Generate Hypothesis strategies for array types.
114114
115-
:param s_name: Slot name to be parsed
115+
:param s_name: Slot name to be parsed.
116116
:param type_dict: A dictionary which values say if the ROS message type is complex (not basic), which is its parent
117-
ROS message module, its type, if it is an array and if so, its size
118-
:param strategy_dict: A pointer to a dictionary to be filled with Hypothesis strategies
117+
ROS message module, its type, if it is an array and if so, its size.
118+
:param strategy_dict: A pointer to a dictionary to be filled with Hypothesis strategies.
119119
"""
120120
if type_dict['array_size']:
121121
array_size = int(type_dict['array_size'])
@@ -132,10 +132,10 @@ def parse_complex_types(s_name, type_dict, strategy_dict):
132132
"""
133133
Generate Hypothesis strategies for complex ROS types.
134134
135-
:param s_name: Slot name to be parsed
135+
:param s_name: Slot name to be parsed.
136136
:param type_dict: A dictionary which values say if the ROS message type is complex (not basic), which is its parent
137-
ROS message module, its type, if it is an array and if so, its size
138-
:param strategy_dict: A pointer to a dictionary to be filled with Hypothesis strategies
137+
ROS message module, its type, if it is an array and if so, its size.
138+
:param strategy_dict: A pointer to a dictionary to be filled with Hypothesis strategies.
139139
"""
140140
if not type_dict['array']:
141141
strategy_dict[s_name] = map_ros_types(ros_msg_loader(type_dict))
@@ -153,9 +153,9 @@ def dynamic_strategy_generator_ros(draw, ros_class, strategy_dict): # This gene
153153
"""
154154
Generates Hypothesis strategies for a certain ROS class.
155155
156-
:param ros_class: The ROS class to be filed with fuzzed values
157-
:param strategy_dict:
158-
:return: A pointer to a dictionary filled with Hypothesis strategies
156+
:param ros_class: The ROS class to be filed with fuzzed values.
157+
:param strategy_dict: Strategy dictionary.
158+
:return: A pointer to a dictionary filled with Hypothesis strategies.
159159
"""
160160
aux_obj = ros_class()
161161
for key, value in strategy_dict.iteritems():

0 commit comments

Comments
 (0)