reuse-tool icon indicating copy to clipboard operation
reuse-tool copied to clipboard

Error messages not actionable

Open MarkCallow opened this issue 3 years ago • 3 comments

Many error messages from reuse lint are not actionable, i.e. not useful or helpful for the end user.

For example I inadvertently commented out a License: line in my dep5 file. I saw the following message for every single file in my repo

reuse.project - ERROR - .reuse/dep5 has syntax errors
Traceback (most recent call last):
  File "/Users/mark/Library/Python/3.7/lib/python/site-packages/reuse/project.py", line 236, in _copyright
    self._copyright_val = Copyright(fp)
  File "/Users/mark/Library/Python/3.7/lib/python/site-packages/debian/copyright.py", line 176, in __init__
    pf = FilesParagraph(p, strict, strict=strict)
  File "/Users/mark/Library/Python/3.7/lib/python/site-packages/debian/copyright.py", line 710, in __init__
    _complain('Files paragraph missing License field', strict)
  File "/Users/mark/Library/Python/3.7/lib/python/site-packages/debian/copyright.py", line 102, in _complain
    raise MachineReadableFormatError(msg)
debian.copyright.MachineReadableFormatError: Files paragraph missing License field

reuse then listed every single file in the repo as having no licensing information. Even if the vast amount of noise had been filtered and I was left with just reuse.project - ERROR - .reuse/dep5 has syntax errors that is not helpful either. What *+%&%ing line number was the syntax error on?

Another example, my dep5 file had this entry with multiple copyrights that previously passed lint

Files: other_include/GL/glew.h other_include/GL/glxew.h other_include/GL/wglew.h other_lib/win/Release-x65/glew32.*
Copyright: 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
Copyright: 2002-2008, Milan Ikits <milan ikits[]ieee org>
Copyright: 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
Copyright: 2002, Lev Povalahev
License: BSD-3-Clause

For every single file in the repo reuse lint printed

ValueError: Duplicate field "Copyright" in paragraph number 29
reuse.report - ERROR - Unexpected error occurred while parsing '<file name>'

It then printed a list of every file in the repo headed

# READ ERRORS

Could not read:

I had to (a) guess that the problem was in the dep5 and (b) guess that "paragraph" corresponds to an entry in the dep5 and (c) manually count to "paragraph" 29 to find the problem.

I don't think I have ever used a more user-unfriendly program. For heaven's sake fix it!

I still don't know what to do about the multiple copyrights that come straight out of the .h file and worked with previous versions of reuse lint.

MarkCallow avatar Dec 02 '22 12:12 MarkCallow

Thanks for reporting.

I don't think I have ever used a more user-unfriendly program. For heaven's sake fix it!

There is quite some error handling in place but this specific case of DEP5 is indeed badly handled looking at the issue. An error should be raised at an earlier stage. Sure this should be addressed, but I think your comment is an exaggeration.

Looking at the DEP5 spec, would a multi-line Copyright statement work? https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#id-1.9.3 like:

Files: other_include/GL/glew.h other_include/GL/glxew.h other_include/GL/wglew.h other_lib/win/Release-x65/glew32.*
Copyright: 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
           2002-2008, Milan Ikits <milan ikits[]ieee org>
           2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
           2002, Lev Povalahev
License: BSD-3-Clause

nicorikken avatar Dec 04 '22 20:12 nicorikken

As I noted in #631 the multi-line copyright statement does work. Thanks for responding.

Since, in both the examples I gave, the same error was emitted for every one of the hundreds of source files in my project reuse lint must be looking at the dep5 file before it looks in a file for licensing and copyright info. Therefore it should stop after the first file when errors are found in dep5.

Also, as an end user, I have no interest in which piece of reuse lint is running when it detects an error. The traceback is noise and should only be emitted when some developer option is specified.

MarkCallow avatar Dec 05 '22 08:12 MarkCallow

Thank you for your time and contributions! Unfortunately, this issue has been inactive for quite a while which means we probably can't manage the time to deal with it. That's why we're marking it as stale. We want to keep things tidy and focus on active discussions, but we’re always happy to revisit if this is still relevant!

If you’d like to keep this open, please add a comment to let us know and remove the label stale. Otherwise, this issue will most likely be automatically closed soon.

github-actions[bot] avatar Jun 15 '25 03:06 github-actions[bot]

Since there hasn't been any recent activity after the last message, we're going to go ahead and close this issue. Feel free to reopen this and remove the labels stale and unresolved if it's urgent.

We truly appreciate your contributions and engagement!

Thank you and happy hacking!

github-actions[bot] avatar Jul 15 '25 03:07 github-actions[bot]