Skip to content

Commit 01f63b6

Browse files
committed
Fix formatting
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent ac378c7 commit 01f63b6

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

scanpipe/pipelines/deploy_to_develop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ def map_javascript(self):
188188
to its source.
189189
"""
190190
d2d.map_javascript(project=self.project, logger=self.log)
191-
191+
192192
@group("Elf")
193193
def map_elf(self):
194194
"""
195-
Map DWARF paths using similarities of path suffixes.
195+
Map DWARF paths using similarities of path suffixes.
196196
"""
197197
d2d.map_elf(project=self.project, logger=self.log)
198198

scanpipe/pipes/d2d.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
from django.template.defaultfilters import pluralize
3939

4040
from commoncode.paths import common_prefix
41+
from elf_inspector.dwarf import get_dwarf_paths
4142
from extractcode import EXTRACT_SUFFIX
4243
from packagedcode.npm import NpmPackageJsonHandler
4344
from summarycode.classify import LEGAL_STARTS_ENDS
44-
from elf_inspector.dwarf import get_dwarf_paths
4545

4646
from scanpipe import pipes
4747
from scanpipe.models import CodebaseRelation
@@ -1666,7 +1666,10 @@ def _match_purldb_resources_post_process(
16661666

16671667

16681668
def _map_dwarf_path_resource(
1669-
to_resource, from_resources, from_resources_index, logger=None,
1669+
to_resource,
1670+
from_resources,
1671+
from_resources_index,
1672+
logger=None,
16701673
):
16711674
"""
16721675
Map DWARF dwarf_paths found in the ``to_resource`` extra_data to
@@ -1705,7 +1708,9 @@ def _map_dwarf_path_resource(
17051708
matched_from_resources = [
17061709
from_resources.get(id=rid) for rid in match.resource_ids
17071710
]
1708-
matched_from_resources.sort(key=lambda res: (len(res.path.strip("/").split("/")), res.path))
1711+
matched_from_resources.sort(
1712+
key=lambda res: (len(res.path.strip("/").split("/")), res.path)
1713+
)
17091714
winning_from_resource = matched_from_resources[0]
17101715

17111716
# Do not count the "to/" segment as it is not "matchable"
@@ -1740,7 +1745,10 @@ def _map_dwarf_path_resource(
17401745
# save the "dwarf dwarf_paths not mapped"
17411746
to_resource.save()
17421747
if logger:
1743-
logger(f"WARNING: DWARF paths NOT mapped for: {to_resource.path!r}: " + ", ".join(map(repr, dpnm)))
1748+
logger(
1749+
f"WARNING: DWARF paths NOT mapped for: {to_resource.path!r}: "
1750+
+ ", ".join(map(repr, dpnm))
1751+
)
17441752

17451753

17461754
def map_elf(project, logger=None):
@@ -1764,9 +1772,7 @@ def map_elf(project, logger=None):
17641772
)
17651773

17661774
if logger:
1767-
logger(
1768-
f"Done building from/ resources index."
1769-
)
1775+
logger(f"Done building from/ resources index.")
17701776

17711777
resource_iterator = to_resources.iterator(chunk_size=2000)
17721778
progress = LoopProgress(resource_count, logger)
@@ -1776,4 +1782,4 @@ def map_elf(project, logger=None):
17761782
from_resources,
17771783
from_resources_index,
17781784
logger=logger,
1779-
)
1785+
)

scanpipe/pipes/elf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@
2121
# Visit https://github.com/nexB/scancode.io for support and download.
2222

2323
from elf_inspector.dwarf import get_dwarf_paths
24-
from scanpipe.pipes import LoopProgress, pathmap
25-
from scanpipe.models import CodebaseRelation
24+
2625
from scanpipe import pipes
26+
from scanpipe.models import CodebaseRelation
27+
from scanpipe.pipes import LoopProgress
28+
from scanpipe.pipes import pathmap
29+
2730

2831
def collect_dwarf_source_path_references(resource):
2932
"""Collect and store the DWARF debug paths of the provided ELF ``resource``."""

0 commit comments

Comments
 (0)