Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message to stderr if output IOErrors in lint #404

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aspiers
Copy link

@aspiers aspiers commented Sep 5, 2021

This is a specific fix for #266 that only covers the lint() output

Written by @fwolfst.

This is a specific fix for fsfe#266 that only covers the lint() output
@mxmehl
Copy link
Member

mxmehl commented Sep 17, 2021

Thanks for the contribution! Could you please provide a test case?

I used a large uncompliant repo and piped to head, but it failed with both your and @fwolfst's solution with the BrokenPipeError.

@aspiers
Copy link
Author

aspiers commented Sep 17, 2021

What was the failure exactly? Worked nicely for me.

@mxmehl
Copy link
Member

mxmehl commented Sep 20, 2021

I cloned go-gitea/gitea and ran reuse lint | head with your version:

$ reuse --version
reuse 0.13.1.dev20+ga26c2d5

$ reuse lint | head
# MISSING LICENSES

'MIT' found in:
* vendor/github.com/issue9/identicon/block.go
* vendor/github.com/issue9/identicon/doc.go
* vendor/github.com/issue9/identicon/identicon.go
* vendor/github.com/issue9/identicon/polygon.go


# MISSING COPYRIGHT AND LICENSING INFORMATION
Traceback (most recent call last):
  File "/home/max/Repositories/fsfe/reuse-tool/venv/bin/reuse", line 33, in <module>
    sys.exit(load_entry_point('reuse', 'console_scripts', 'reuse')())
  File "/home/max/Repositories/fsfe/reuse-tool/src/reuse/_main.py", line 256, in main
    return parsed_args.func(parsed_args, project, out)
  File "/home/max/Repositories/fsfe/reuse-tool/src/reuse/lint.py", line 335, in run
    result = lint(report, out=out)
  File "/home/max/Repositories/fsfe/reuse-tool/src/reuse/lint.py", line 32, in lint
    files_without_cali = lint_files_without_copyright_and_licensing(
  File "/home/max/Repositories/fsfe/reuse-tool/src/reuse/lint.py", line 220, in lint_files_without_copyright_and_licensing
    _write_element(file_, out=out)
  File "/home/max/Repositories/fsfe/reuse-tool/src/reuse/lint.py", line 20, in _write_element
    out.write(str(element))
BrokenPipeError: [Errno 32] Broken pipe

Can you confirm it?

@floriansnow
Copy link
Contributor

@aspiers Do you have time to answer Max's question and provide a test?

@mxmehl mxmehl added this to the v1.0.0 milestone May 6, 2022
@aspiers
Copy link
Author

aspiers commented May 6, 2022

Not in the next week or two unfortunately, but if no one else can help soon, then I would aim to do it at some point.

@mxmehl mxmehl modified the milestones: v1.0.0, Backlog May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants