fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
376 stars 144 forks source link

Write test for raw `*` and raw `**` in REUSE.toml #981

Closed carmenbianca closed 3 months ago

carmenbianca commented 3 months ago

See the tests here: https://github.com/fsfe/reuse-tool/blob/7ab812407cb62b590d0a646546b1cfa7b4661e66/tests/test_global_licensing.py#L228

There should be tests for raw * and raw **.

mxmehl commented 3 months ago

Also, this test fails, but according to the 3.2 draft spec it should work:

def test_match_asterisk(self):
    """Match everything in local directory."""
    item = AnnotationsItem(paths=["*"])
    assert item.matches("foo.py")
    assert item.matches(".gitignore")
    assert not item.matches("src/foo.py")
    assert not item.matches(".foo/bar")
mxmehl commented 3 months ago

Something with * feels broken. I tested reuse convert-dep5 on the curl repository. While the REUSE.toml file looks good, reuse does not detect the files covered by asterisks, e.g. path = ["tests/data/test*", "tests/certs/*"]

carmenbianca commented 3 months ago

My hypothesis is that * is broken when it's the final character. This makes sense when I remember my implementation.