Skip to content

Commit b3acde0

Browse files
committed
Enable LicenseReference plugin correctly
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent edaef02 commit b3acde0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/licensedcode/licenses_reference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class LicenseReference(PostScanPlugin):
4848
# TODO: send to the tail of the scan, after files
4949
sort_order = 1000
5050

51-
def is_enabled(self, **kwargs): # NOQA
52-
return 'license' in kwargs or 'package' in kwargs
51+
def is_enabled(self, **kwargs):
52+
return kwargs.get('license') or kwargs.get('package')
5353

5454
def process_codebase(self, codebase, **kwargs):
5555
"""
@@ -151,7 +151,7 @@ def collect_references_from_files(codebase):
151151
rules_by_identifier = {}
152152

153153
for resource in codebase.walk():
154-
expression = getattr(resource, 'detected_license_expression')
154+
expression = getattr(resource, 'detected_license_expression', None)
155155
if expression:
156156
license_keys.update(licensing.license_keys(expression))
157157

0 commit comments

Comments
 (0)