Skip to content

Commit 1cfd0b7

Browse files
committed
Filter out inactive copyrights.
Most inactive copyrights appear to be strings (usually source code) that loosely resemble a copyright statement, but usually aren't. I'm not sure why the KB has these "inactive" copyrights at all. My guess is that it *used* to match the copyright pattern, but those patterns have changed over time and it no longer matches. So instead of throwing it away, we just mark it as "inactive".
1 parent 1717aab commit 1cfd0b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/bd-upstream-copyrights/get_upstream_copyrights.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ def main():
8484

8585
for component in bd.get_resource("components", project_version):
8686
try:
87-
copyrights = find_copyrights_in_bom_component_origins(component) \
87+
all_copyrights = find_copyrights_in_bom_component_origins(component) \
8888
or find_copyrights_in_github_origins(component) \
8989
or find_copyrights_in_previous_component_versions(component)
9090

91-
if copyrights:
92-
print_copyrights(component, copyrights)
91+
active_copyrights = [c for c in all_copyrights if c['active'] == True]
92+
93+
if active_copyrights:
94+
print_copyrights(component, active_copyrights)
9395
else:
9496
components_with_no_copyrights.append(component)
9597

0 commit comments

Comments
 (0)