-
Notifications
You must be signed in to change notification settings - Fork 152
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
Find license identifiers in comments with ASCII art frames #560
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm not sure if the case this covers is a good general case, but we can cross that bridge when someone else's ASCII art breaks.
Thanks for the PR! Please make sure to add a change log entry, and add yourself to AUTHORS.rst if you want.
50deb5f
to
ffe9692
Compare
Thanks for the quick review! I should've addressed everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's a clever approach a nice first step!
Hey all, thanks for the reviews! What are the next steps to get this merged and released? |
…Simulacrum Initial implementation of REUSE This PR implements the first two steps of rust-lang#99414 by: * Adding some scaffolding for REUSE. The `.reuse/dep5` file now marks every file as the custom "TODO" license, which I'll remove in a future PR once Debian imports their metadata. The TODO license is needed so that `reuse lint` works. * Runs `reuse lint` in CI, in the `mingw-check` builder. REUSE currently has a bug when parsing some files in the LLVM source code. This means REUSE will fail when running it in source tarballs of rustc, and that bug prevents us from passing the `--include-submodules` flag in CI. I opened fsfe/reuse-tool#560 upstream with a fix, and as soon as it's merged/released I planned to bump the pinned version to include the fix we need. r? `@Mark-Simulacrum`
@pietroalbini Sorry for the delay. This gets merged now for the next release, which shouldn't be too long away. |
The Rust project is working to adopt REUSE to annotate licenses, but when working on the initial implementation I stumbled on #343. The Rust repository has LLVM as one of its submodules, and REUSE currently errors out on some of the LLVM comments:
As #343 correctly pointed out, the problem is that LLVM uses ASCII art "frames" for those code comments, like:
The solution I came up with is to implement generic handling for these kinds of ASCII art, even in cases where the multiline delimiter (in this case
*
) is not present. When there are some non-whitespace chars beforeSPDX-License-Identifier
, the new code tries to strip the reverse of them from the end of the line. That correctly handles LLVM comments, but also any other ASCII art frame that's symmetric.Fixes #343