8000 reuse-tool does not properly handle the whitespace control modifiers in the Jinja2 comment lines · Issue #884 · fsfe/reuse-tool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

reuse-tool does not properly handle the whitespace control modifiers in the Jinja2 comment lines #884

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

Closed
brlin-tw opened this issue Dec 22, 2023 · 4 comments
Labels
bug Something isn't working comment-styles Request for a new comment style, or fixing a bug with these stale unresolved

Comments

@brlin-tw
Copy link
brlin-tw commented Dec 22, 2023

According to Whitespace Control — Template Designer Documentation — Jinja Documentation comments and other Jinja2 constructs can contain modifiers to control their whitespace control behavior, making the following markups possible:

  • {#- comment #}
  • {# comment -#}
  • {#+ comment #}
  • {# comment +#}

Unfortunately, currently, the reuse-tool doesn't properly handle these modifiers and may consider the -/+ signs as part of the license declaration content.

Sample input file

{# Copyright 2023 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com> -#}
{# SPDX-License-Identifier: CC-BY-SA-4.0 -#}

Expected behavior

The CC-BY-SA-4.0 license declaration is properly detected.

Current behavior

The reuse lint command returns the following output:

$ reuse lint
# BAD LICENSES

'CC-BY-SA-4.0+ -' found in:
* test.j2

# MISSING LICENSES

'CC-BY-SA-4.0+ -' found in:
* test.j2

# SUMMARY

* Bad licenses: CC-BY-SA-4.0+ -
* Deprecated licenses: 0
* Licenses without file extension: 0
* Missing licenses: CC-BY-SA-4.0+ -
* Unused licenses: 0
* Used licenses: CC-BY-SA-4.0+ -
* Read errors: 0
* files with copyright information: 1 / 1
* files with license information: 1 / 1

Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(

It appears that the whitespace control modifier is treated literally as part of the license declaration.

Additional information

This issue is reproduced in reuse-tool 2.1.0.

@brlin-tw
Copy link
Author

A sample reproducible PoC is made: https://gitlab.com/brlin/reuse-tool-issue-884-bug-poc

@carmenbianca
Copy link
Member

Thanks for the report! This is a problem indeed.

@carmenbianca carmenbianca added bug Something isn't working comment-styles Request for a new comment style, or fixing a bug with these labels Jan 2, 2024
Copy link

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 github-actions bot added the stale label Apr 13, 2025
Copy link

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 github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comment-styles Request for a new comment style, or fixing a bug with these stale unresolved
Projects
None yet
Development

No branches or pull requests

2 participants
0