Skip to content

Commit f0b8cd0

Browse files
committed
Fixed #524 - Remove irrelevant error for attrib
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent e25f207 commit f0b8cd0

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
==============================
22
Changelog
3-
2023-03-07
4-
Release 7.2.1
3+
2023-xx-xx
4+
Release 7.3.0
55

66
* Fixed the transform code for xlsx and json
7+
* Remove irrelevant error for attrib
78

89

910
2022-10-24

src/attributecode/cmd.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,23 +493,25 @@ def attrib(input, output, api_url, api_key, scancode, min_license_score, referen
493493
if not reference:
494494
# Set current directory as the reference dir
495495
reference = os.path.dirname(input)
496-
errors, abouts = load_inventory(
496+
# Since the errors from load_inventory is only about field formatting or
497+
# empty field which is irrelevant for attribtion process,
498+
# See https://github.com/nexB/aboutcode-toolkit/issues/524
499+
# I believe we do not need to capture these errors in attrib process
500+
_errors, abouts = load_inventory(
497501
location=input,
498502
from_attrib=from_attrib,
499503
scancode=scancode,
500504
reference_dir=reference
501505
)
506+
502507
else:
503508
is_about_input = True
504-
errors, abouts = collect_inventory(input)
509+
_errors, abouts = collect_inventory(input)
505510

506511
if not abouts:
507-
if errors:
508-
errors_count = report_errors(errors, quiet, verbose, log_file_loc=output + '-error.log')
509-
else:
510-
msg = 'No ABOUT file or reference is found from the input. Attribution generation halted.'
511-
click.echo(msg)
512-
errors_count = 1
512+
msg = 'No ABOUT file or reference is found from the input. Attribution generation halted.'
513+
click.echo(msg)
514+
errors_count = 1
513515
sys.exit(errors_count)
514516

515517
if not is_about_input:

0 commit comments

Comments
 (0)