Skip to content

Commit

Permalink
Use option dependencies for summary
Browse files Browse the repository at this point in the history
Using option dependencies is cleaner than chaning how an option
is enabled.

Reference: #2842
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Mar 11, 2022
1 parent d3d8a38 commit f968acd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/summarycode/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class LicenseClarityScore(PostScanPlugin):
]

def is_enabled(self, license_clarity_score, **kwargs):
return license_clarity_score or kwargs.get('summary2')
return license_clarity_score

def process_codebase(self, codebase, license_clarity_score, **kwargs):
if TRACE:
Expand Down
4 changes: 3 additions & 1 deletion src/summarycode/summarizer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class ScanSummary(PostScanPlugin):
PluggableCommandLineOption(('--summary2',),
is_flag=True, default=False,
help='Summarize license, copyright and other scans at the codebase level.',
help_group=POST_SCAN_GROUP)
help_group=POST_SCAN_GROUP,
required_options=['classify', 'license_clarity_score']
)
]

def is_enabled(self, summary2, **kwargs):
Expand Down

0 comments on commit f968acd

Please sign in to comment.