Skip to content

Commit 1b508c8

Browse files
committed
Build licenserules with no referenced_filenames
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 7b17bb1 commit 1b508c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

etc/scripts/licenses/buildrules.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from licensedcode import cache
1616
from licensedcode import models
17-
from licensedcode import match_hash
1817
from licensedcode import frontmatter
1918
from licensedcode.models import get_rule_id_for_text
2019
from license_expression import Licensing
@@ -73,7 +72,13 @@ def __attrs_post_init__(self, *args, **kwargs):
7372
print(rdat)
7473
print("########################################################")
7574
raise
76-
self.data = {k: v for k, v in self.data.items() if v is not None or (v is None and k == "license_expression")}
75+
if "referenced_filenames" in self.data and not self.data["referenced_filenames"]:
76+
self.data.pop("referenced_filenames")
77+
self.data = {
78+
k: v for k, v in self.data.items()
79+
if v is not None
80+
or (v is None and k == "license_expression")
81+
}
7782

7883

7984
def load_data(location="00-new-licenses.txt"):

0 commit comments

Comments
 (0)