adding a linter workflow #3
46 errors
Black found 46 errors
Annotations
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/launch/deepracer_launch.py#L4-L28
from launch.actions import DeclareLaunchArgument
from ament_index_python.packages import get_package_share_directory
import os
import yaml
+
def generate_launch_description():
ld = LaunchDescription()
config = os.path.join(
- get_package_share_directory('camera_object_detection'),
- 'config',
- 'deeepracer.yaml'
+ get_package_share_directory("camera_object_detection"),
+ "config",
+ "deeepracer.yaml",
)
# nodes
camera_object_detection_node = Node(
- package='camera_object_detection',
- executable='camera_object_detection_node',
- name='camera_object_detection_node',
- parameters=[config]
+ package="camera_object_detection",
+ executable="camera_object_detection_node",
+ name="camera_object_detection_node",
+ parameters=[config],
)
# finalize
ld.add_action(camera_object_detection_node)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/launch/sim_launch.py#L4-L28
from launch.actions import DeclareLaunchArgument
from ament_index_python.packages import get_package_share_directory
import os
import yaml
+
def generate_launch_description():
ld = LaunchDescription()
config = os.path.join(
- get_package_share_directory('camera_object_detection'),
- 'config',
- 'sim_config.yaml'
+ get_package_share_directory("camera_object_detection"),
+ "config",
+ "sim_config.yaml",
)
# nodes
camera_object_detection_node = Node(
- package='camera_object_detection',
- executable='camera_object_detection_node',
- name='camera_object_detection_node',
- parameters=[config]
+ package="camera_object_detection",
+ executable="camera_object_detection_node",
+ name="camera_object_detection_node",
+ parameters=[config],
)
# finalize
ld.add_action(camera_object_detection_node)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/launch/nuscenes_launch.py#L4-L29
from launch.actions import DeclareLaunchArgument
from ament_index_python.packages import get_package_share_directory
import os
import yaml
+
def generate_launch_description():
ld = LaunchDescription()
config = os.path.join(
- get_package_share_directory('camera_object_detection'),
- 'config',
- 'nuscenes_config.yaml'
+ get_package_share_directory("camera_object_detection"),
+ "config",
+ "nuscenes_config.yaml",
)
# nodes
camera_object_detection_node = Node(
- package='camera_object_detection',
- executable='camera_object_detection_node',
- name='camera_object_detection_node',
+ package="camera_object_detection",
+ executable="camera_object_detection_node",
+ name="camera_object_detection_node",
parameters=[config],
- arguments=['--ros-args', '--log-level', 'info']
+ arguments=["--ros-args", "--log-level", "info"],
)
# finalize
ld.add_action(camera_object_detection_node)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/test/test_flake8.py#L18-L26
@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
- assert rc == 0, \
- 'Found %d code style errors / warnings:\n' % len(errors) + \
- '\n'.join(errors)
+ assert rc == 0, "Found %d code style errors / warnings:\n" % len(
+ errors
+ ) + "\n".join(errors)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/test/test_copyright.py#L15-L26
from ament_copyright.main import main
import pytest
# Remove the `skip` decorator once the source file(s) have a copyright header
[email protected](reason='No copyright header has been placed in the generated source file.')
[email protected](
+ reason="No copyright header has been placed in the generated source file."
+)
@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
- rc = main(argv=['.', 'test'])
- assert rc == 0, 'Found errors'
+ rc = main(argv=[".", "test"])
+ assert rc == 0, "Found errors"
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/setup.py#L1-L31
from setuptools import setup
import os
from glob import glob
-package_name = 'camera_object_detection'
+package_name = "camera_object_detection"
setup(
name=package_name,
- version='0.0.0',
+ version="0.0.0",
packages=[package_name],
data_files=[
- ('share/ament_index/resource_index/packages',
- ['resource/' + package_name]),
- ('share/' + package_name, ['package.xml']),
- (os.path.join('share', package_name, 'launch'), glob('launch/*.py')),
- (os.path.join('share', package_name, 'config'), glob('config/*.yaml')),
+ ("share/ament_index/resource_index/packages", ["resource/" + package_name]),
+ ("share/" + package_name, ["package.xml"]),
+ (os.path.join("share", package_name, "launch"), glob("launch/*.py")),
+ (os.path.join("share", package_name, "config"), glob("config/*.yaml")),
],
- install_requires=['setuptools'],
+ install_requires=["setuptools"],
zip_safe=True,
- maintainer='Steven',
- maintainer_email='[email protected]',
- description='TODO: Package description',
- license='TODO: License declaration',
- tests_require=['pytest'],
+ maintainer="Steven",
+ maintainer_email="[email protected]",
+ description="TODO: Package description",
+ license="TODO: License declaration",
+ tests_require=["pytest"],
entry_points={
- 'console_scripts': [
- 'camera_object_detection_node = camera_object_detection.yolov8_detection:main'
+ "console_scripts": [
+ "camera_object_detection_node = camera_object_detection.yolov8_detection:main"
],
},
)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/radar_object_detection/radar_object_detection_launch/launch/radar_object_detection.launch.py#L3-L15
def generate_launch_description():
"""Launch Radar object detection system."""
radar_vis_node = Node(
- package='radar_vis',
- executable='radar_vis_node',
+ package="radar_vis",
+ executable="radar_vis_node",
)
- return LaunchDescription([
- radar_vis_node
- ])
+ return LaunchDescription([radar_vis_node])
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/perception/camera_object_detection/test/test_pep257.py#L17-L24
@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
- rc = main(argv=['.', 'test'])
- assert rc == 0, 'Found code style errors / warnings'
+ rc = main(argv=[".", "test"])
+ assert rc == 0, "Found code style errors / warnings"
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/cpp/aggregator/launch/aggregator.launch.py#L3-L15
def generate_launch_description():
"""Launch aggregator node."""
aggregator_node = Node(
- package='aggregator',
- executable='aggregator_node',
+ package="aggregator",
+ executable="aggregator_node",
)
- return LaunchDescription([
- aggregator_node
- ])
+ return LaunchDescription([aggregator_node])
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/cpp/producer/launch/producer.launch.py#L7-L33
import os
def generate_launch_description():
"""Launch producer node."""
- producer_pkg_prefix = get_package_share_directory('producer')
- producer_param_file = os.path.join(
- producer_pkg_prefix, 'config', 'params.yaml')
+ producer_pkg_prefix = get_package_share_directory("producer")
+ producer_param_file = os.path.join(producer_pkg_prefix, "config", "params.yaml")
producer_param = DeclareLaunchArgument(
- 'producer_param_file',
+ "producer_param_file",
default_value=producer_param_file,
- description='Path to config file for producer node'
+ description="Path to config file for producer node",
)
producer_node = Node(
- package='producer',
- name='producer_node',
- executable='producer_node',
- parameters=[LaunchConfiguration('producer_param_file')],
+ package="producer",
+ name="producer_node",
+ executable="producer_node",
+ parameters=[LaunchConfiguration("producer_param_file")],
)
- return LaunchDescription([
- producer_param,
- producer_node
- ])
+ return LaunchDescription([producer_param, producer_node])
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/cpp/transformer/launch/transformer.launch.py#L7-L32
import os
def generate_launch_description():
"""Launch transformer node."""
- transformer_pkg_prefix = get_package_share_directory('transformer')
+ transformer_pkg_prefix = get_package_share_directory("transformer")
transformer_param_file = os.path.join(
- transformer_pkg_prefix, 'config', 'params.yaml')
+ transformer_pkg_prefix, "config", "params.yaml"
+ )
transformer_param = DeclareLaunchArgument(
- 'transformer_param_file',
+ "transformer_param_file",
default_value=transformer_param_file,
- description='Path to config file for transformer node'
+ description="Path to config file for transformer node",
)
transformer_node = Node(
- package='transformer',
- executable='transformer_node',
- parameters=[LaunchConfiguration('transformer_param_file')],
+ package="transformer",
+ executable="transformer_node",
+ parameters=[LaunchConfiguration("transformer_param_file")],
)
- return LaunchDescription([
- transformer_param,
- transformer_node
- ])
+ return LaunchDescription([transformer_param, transformer_node])
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/aggregator/aggregator_core.py#L13-L24
# limitations under the License.
import time
-class AggregatorCore():
+class AggregatorCore:
def __init__(self, start_time):
# Init member variables to calculate msg frequency
self.num_unfiltered_msgs = 0
self.num_filtered_msgs = 0
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/launch/aggregator.launch.py#L15-L28
from launch import LaunchDescription
import launch_ros.actions
def generate_launch_description():
- return LaunchDescription([
- launch_ros.actions.Node(
- name='aggregator_node',
- package='aggregator',
- executable='aggregator_node',
- output='screen',
- emulate_tty=True),
- ])
+ return LaunchDescription(
+ [
+ launch_ros.actions.Node(
+ name="aggregator_node",
+ package="aggregator",
+ executable="aggregator_node",
+ output="screen",
+ emulate_tty=True,
+ ),
+ ]
+ )
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/test/test_copyright.py#L17-L24
@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
- rc = main(argv=['.', 'test'])
- assert rc == 0, 'Found errors'
+ rc = main(argv=[".", "test"])
+ assert rc == 0, "Found errors"
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/setup.py#L1-L33
import os
from glob import glob
from setuptools import setup
-package_name = 'aggregator'
+package_name = "aggregator"
setup(
name=package_name,
- version='0.0.0',
+ version="0.0.0",
packages=[package_name],
data_files=[
# Install marker file in the package index
- ('share/ament_index/resource_index/packages', ['resource/' + package_name]),
+ ("share/ament_index/resource_index/packages", ["resource/" + package_name]),
# Include our package.xml file
- (os.path.join('share', package_name), ['package.xml']),
+ (os.path.join("share", package_name), ["package.xml"]),
# Include all launch files.
- (os.path.join('share', package_name, 'launch'), \
- glob(os.path.join('launch', '*.launch.py'))),
+ (
+ os.path.join("share", package_name, "launch"),
+ glob(os.path.join("launch", "*.launch.py")),
+ ),
],
- install_requires=['setuptools'],
+ install_requires=["setuptools"],
zip_safe=True,
- maintainer='eddyzhou, aryanafrouzi',
- maintainer_email='[email protected], [email protected]',
- description='TODO: Package description',
- license='TODO: License declaration',
- tests_require=['pytest'],
+ maintainer="eddyzhou, aryanafrouzi",
+ maintainer_email="[email protected], [email protected]",
+ description="TODO: Package description",
+ license="TODO: License declaration",
+ tests_require=["pytest"],
entry_points={
- 'console_scripts': [
- 'aggregator_node = aggregator.aggregator_node:main'
- ],
+ "console_scripts": ["aggregator_node = aggregator.aggregator_node:main"],
},
)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/aggregator/aggregator_node.py#L21-L63
class Aggregator(Node):
def __init__(self):
- super().__init__('python_aggregator')
+ super().__init__("python_aggregator")
# Initialize Core Aggregator Logic (freq updates)
node_start_time = time.time()
self.__aggregator = AggregatorCore(node_start_time)
# Initialize ROS2 Constructs
- self.unfiltered_subcriber = self.create_subscription(Unfiltered,
- '/unfiltered_topic',
- self.unfiltered_callback,
- 10)
- self.filtered_subscriber = self.create_subscription(FilteredArray,
- '/filtered_topic',
- self.filtered_callback,
- 10)
+ self.unfiltered_subcriber = self.create_subscription(
+ Unfiltered, "/unfiltered_topic", self.unfiltered_callback, 10
+ )
+ self.filtered_subscriber = self.create_subscription(
+ FilteredArray, "/filtered_topic", self.filtered_callback, 10
+ )
def unfiltered_callback(self, msg):
self.__aggregator.update_raw_freq()
self.print_freqs()
def filtered_callback(self, msg):
self.__aggregator.update_filtered_freq()
self.print_freqs()
def print_freqs(self):
- self.get_logger().info('Number of unfiltered messages:' +
- str(self.__aggregator.num_unfiltered_msgs))
- self.get_logger().info('Number of filtered messages:' +
- str(self.__aggregator.num_filtered_msgs))
+ self.get_logger().info(
+ "Number of unfiltered messages:"
+ + str(self.__aggregator.num_unfiltered_msgs)
+ )
+ self.get_logger().info(
+ "Number of filtered messages:" + str(self.__aggregator.num_filtered_msgs)
+ )
- self.get_logger().info('Producer Frequency:' + str(self.__aggregator.raw_freq))
- self.get_logger().info('Transformer Frequency:' + str(self.__aggregator.filtered_freq))
+ self.get_logger().info("Producer Frequency:" + str(self.__aggregator.raw_freq))
+ self.get_logger().info(
+ "Transformer Frequency:" + str(self.__aggregator.filtered_freq)
+ )
def main(args=None):
rclpy.init(args=args)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/aggregator/aggregator_node.py#L69-L76
# when the garbage collector destroys the node object)
python_aggregator.destroy_node()
rclpy.shutdown()
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/test/test_pep257.py#L17-L24
@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
- rc = main(argv=['.', 'test'])
- assert rc == 0, 'Found code style errors / warnings'
+ rc = main(argv=[".", "test"])
+ assert rc == 0, "Found code style errors / warnings"
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/aggregator/test/test_flake8.py#L18-L26
@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
- assert rc == 0, \
- 'Found %d code style errors / warnings:\n' % len(errors) + \
- '\n'.join(errors)
+ assert rc == 0, "Found %d code style errors / warnings:\n" % len(
+ errors
+ ) + "\n".join(errors)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/launch/producer.launch.py#L22-L40
def generate_launch_description():
# To load the yaml file, we are searching for its
# path is the share directory. Check setup.py for how
# the param file got there
param_file_path = os.path.join(
- get_package_share_directory('producer'),
- 'config',
- 'params.yaml'
+ get_package_share_directory("producer"), "config", "params.yaml"
)
- return LaunchDescription([
- Node(
- package='producer',
- name='producer_node',
- executable='producer_node',
- parameters=[param_file_path]
- )
- ])
+ return LaunchDescription(
+ [
+ Node(
+ package="producer",
+ name="producer_node",
+ executable="producer_node",
+ parameters=[param_file_path],
+ )
+ ]
+ )
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/producer/producer_core.py#L13-L24
# limitations under the License.
import math
-class ProducerCore():
+class ProducerCore:
def __init__(self, pos_x, pos_y, pos_z, vel):
# Init member variables for serialization
self.__pos_x = pos_x
self.__pos_y = pos_y
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/producer/producer_core.py#L29-L36
self.__pos_x += self.__velocity / math.sqrt(3)
self.__pos_y += self.__velocity / math.sqrt(3)
self.__pos_z += self.__velocity / math.sqrt(3)
def serialize_data(self):
- return "x:" + str(self.__pos_x) + ";y:" + \
- str(self.__pos_y) + ";z:" + str(self.__pos_z) + ";"
+ return (
+ "x:"
+ + str(self.__pos_x)
+ + ";y:"
+ + str(self.__pos_y)
+ + ";z:"
+ + str(self.__pos_z)
+ + ";"
+ )
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/test/test_copyright.py#L17-L24
@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
- rc = main(argv=['.', 'test'])
- assert rc == 0, 'Found errors'
+ rc = main(argv=[".", "test"])
+ assert rc == 0, "Found errors"
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/setup.py#L1-L35
import os
from glob import glob
from setuptools import setup
-package_name = 'producer'
+package_name = "producer"
setup(
name=package_name,
- version='0.0.0',
+ version="0.0.0",
packages=[package_name],
data_files=[
# Install marker file in the package index
- ('share/ament_index/resource_index/packages', ['resource/' + package_name]),
+ ("share/ament_index/resource_index/packages", ["resource/" + package_name]),
# Include our package.xml file
- (os.path.join('share', package_name), ['package.xml']),
+ (os.path.join("share", package_name), ["package.xml"]),
# Include all launch files
- (os.path.join('share', package_name, 'launch'),
- glob(os.path.join('launch', '*.launch.py'))),
+ (
+ os.path.join("share", package_name, "launch"),
+ glob(os.path.join("launch", "*.launch.py")),
+ ),
# Include config files for parameters
- (os.path.join('share', package_name, 'config'), glob(os.path.join('config', '*.yaml'))),
+ (
+ os.path.join("share", package_name, "config"),
+ glob(os.path.join("config", "*.yaml")),
+ ),
],
- install_requires=['setuptools'],
+ install_requires=["setuptools"],
zip_safe=True,
- maintainer='eddyzhou, aryanafrouzi',
- maintainer_email='[email protected], [email protected]',
- description='TODO: Package description',
- license='TODO: License declaration',
- tests_require=['pytest'],
+ maintainer="eddyzhou, aryanafrouzi",
+ maintainer_email="[email protected], [email protected]",
+ description="TODO: Package description",
+ license="TODO: License declaration",
+ tests_require=["pytest"],
entry_points={
- 'console_scripts': [
- 'producer_node = producer.producer_node:main'
- ],
+ "console_scripts": ["producer_node = producer.producer_node:main"],
},
)
github-actions / Black
/home/runner/work/wato_monorepo/wato_monorepo/src/samples/python/producer/test/test_flake8.py#L18-L26
@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
- assert rc == 0, \
- 'Found %d code style errors / warnings:\n' % len(errors) + \
- '\n'.join(errors)
+ assert rc == 0, "Found %d code style errors / warnings:\n" % len(
+ errors
+ ) + "\n".join(errors)