@@ -64,8 +64,8 @@ def logger_debug(*args):
6464@post_scan_impl
6565class OriginSummary (PostScanPlugin ):
6666 """
67- Rolls up copyright and license results to the directory level if a copyright or license
68- is detected in 75% or more of total files in a directory
67+ Summarize copyright holders and license expressions to the directory level if a copyright holder
68+ or license expression is detected in 75% or more of total files in a directory
6969 """
7070 resource_attributes = dict (
7171 origin_summary = attr .ib (default = attr .Factory (OrderedDict )),
@@ -77,8 +77,11 @@ class OriginSummary(PostScanPlugin):
7777 options = [
7878 CommandLineOption (('--origin-summary' ,),
7979 is_flag = True , default = False ,
80- help = 'Origin summary' ,
81- help_group = POST_SCAN_GROUP )
80+ help = 'Summarize copyright holders and license expressions to the directory level '
81+ 'if a copyright holder or license expression is detected in 75% or more of '
82+ 'total files in a directory' ,
83+ help_group = POST_SCAN_GROUP
84+ )
8285 ]
8386
8487 def is_enabled (self , origin_summary , ** kwargs ):
@@ -106,7 +109,7 @@ def process_codebase(self, codebase, **kwargs):
106109 for child in children :
107110 if child .is_file :
108111 license_expression = combine_expressions (child .license_expressions )
109- holders = tuple (h ['value' ] for h in child .holders if h [ 'value' ] )
112+ holders = tuple (h ['value' ] for h in child .holders )
110113 if not license_expression or not holders :
111114 continue
112115 origin = holders , license_expression
@@ -145,7 +148,7 @@ def process_codebase(self, codebase, **kwargs):
145148
146149def is_majority (count , files_count ):
147150 """
148- Return True is this resource is a whatever directory with at least over 75% of whatever at full depth.
151+ Return True if `count` is 75% or more of `files_count`
149152 """
150153 # TODO: Increase this and test with real codebases
151154 return count / files_count >= 0.75
0 commit comments