Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
Reference: #2842
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Mar 11, 2022
1 parent ab70896 commit dbc578d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/summarycode/summarizer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def process_codebase(self, codebase, summary2, **kwargs):
summarize_codebase(codebase, keep_details=False, **kwargs)



def summarize_codebase(codebase, keep_details, **kwargs):
"""
Summarize a scan at the codebase level for available scans.
Expand All @@ -95,7 +94,11 @@ def summarize_codebase(codebase, keep_details, **kwargs):

for summarizer in summarizers:
_summary_data = summarizer(resource, children, keep_details=keep_details)
if TRACE: logger_debug('summary for:', resource.path, 'after summarizer:', summarizer, 'is:', _summary_data)
if TRACE:
logger_debug(
'summary for:', resource.path, 'after summarizer:',
summarizer, 'is:', _summary_data,
)

codebase.save_resource(resource)

Expand All @@ -104,6 +107,7 @@ def summarize_codebase(codebase, keep_details, **kwargs):
summary = root.summary
else:
summary = root.extra_data.get('summary', {})

codebase.attributes.summary.update(summary)

if TRACE: logger_debug('codebase summary:', summary)
Expand All @@ -119,7 +123,7 @@ def license_summarizer(resource, children, keep_details=False):
license_expressions = []

# Collect current data
lic_expressions = getattr(resource, LIC_EXP , [])
lic_expressions = getattr(resource, LIC_EXP, [])
if not lic_expressions and resource.is_file:
# also count files with no detection
license_expressions.append(None)
Expand Down

0 comments on commit dbc578d

Please sign in to comment.