Skip to content

Commit 03b326a

Browse files
Wrap to 80 characters
1 parent 546804b commit 03b326a

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

bazel_ros2_rules/ros2/resources/cmake_tools/file_api.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ def __init__(self, target_file: Path):
6969
if fragment['role'] == 'flags':
7070
self.link_flags.append(fragment['fragment'])
7171
elif fragment['role'] == 'libraries':
72-
# In the generated JSON a library can be in quotes (to escape some characters?)
73-
# This escaping creates problem down the line ("/usr/lib/libfoo.so" is *not* a path)
72+
# In the generated JSON a library can be in quotes, in
73+
# order to escape some characters.
74+
# This escaping creates problem down the line,
75+
# "/usr/lib/libfoo.so" is *not* a path.
7476
# We remove the escaping here so they can be treated normally
7577
link_library = fragment['fragment']
76-
if link_library.startswith('"') and link_library.endswith('"'):
78+
if link_library.startswith('"') and \
79+
link_library.endswith('"'):
7780
link_library = link_library.strip('"')
7881
self.link_libraries.append(link_library)
7982
elif fragment['role'] == 'libraryPath':

bazel_ros2_rules/ros2/resources/ros2bzl/scraping/ament_python.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ def find_python_package(name):
1414
dist = distribution(name)
1515
top_level = dist.read_text('top_level.txt')
1616
top_level = top_level.rstrip('\n')
17-
return str(dist._path), '\n'.join([str(dist.locate_file(top_level_i)) for top_level_i in top_level.split('\n')])
17+
return str(dist._path), "\n".join(
18+
[
19+
str(dist.locate_file(top_level_i))
20+
for top_level_i in top_level.split("\n")
21+
]
22+
)
1823

1924

2025
def collect_ament_python_package_properties(name, metadata):

bazel_ros2_rules/ros2/resources/ros2bzl/scraping/metadata.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def remove_ros1_elements(root):
99
for parent in root.iter():
1010
for child in list(parent):
1111
if "condition" in child.attrib:
12-
if child.get('condition') == ros1_condition_value :
12+
if child.get('condition') == ros1_condition_value:
1313
elements_to_remove.append((parent, child))
14-
else :
14+
else:
1515
child.attrib.pop("condition")
1616

1717
for parent, child in elements_to_remove:

bazel_ros2_rules/ros2/resources/ros2bzl/templates.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ def configure_package_py_library(
151151
target_name = py_name(name, metadata)
152152
eggs = [sandbox(egg_path) for egg_path, _ in properties.python_packages]
153153
tops = [
154-
sandbox(top_level_i) for _, top_level in properties.python_packages for top_level_i in top_level.split("\n")]
154+
sandbox(top_level_i)
155+
for _, top_level in properties.python_packages
156+
for top_level_i in top_level.split("\n")
157+
]
155158
imports = [os.path.dirname(egg) for egg in eggs]
156159

157160
template = 'templates/package_py_library.bazel.tpl'

bazel_ros2_rules/ros2/resources/templates/package_cc_library.bazel.tpl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
cc_library(
22
name = @name@,
33
srcs = @srcs@,
4-
hdrs = glob(["{}/**/*.h*".format(x) for x in @headers@] + ["{}/**/*.inc".format(x) for x in @headers@], allow_empty = True),
4+
hdrs = glob(
5+
["{}/**/*.h*".format(x) for x in @headers@] +
6+
["{}/**/*.inc".format(x) for x in @headers@],
7+
allow_empty = True,
8+
),
59
includes = @includes@,
610
copts = @copts@,
711
defines = @defines@,

0 commit comments

Comments
 (0)