fsfe / reuse-tool

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

Failure to parse files with mac line endings (CR line terminator) #742

Open tenzap opened 1 year ago

tenzap commented 1 year ago

This file has mac line endings (CR line terminator)

https://raw.githubusercontent.com/qt/qtbase/dev/tests/auto/tools/moc/os9-newlines.h

$ file os9-newlines.h 
os9-newlines.h: ASCII text, with CR line terminators

reuse fails parsing it

$ reuse spdx                
reuse.project - WARNING - could not find supported VCS
};' inline void testSlot() {}bjectrse 'LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
reuse.project - ERROR - 'os9-newlines.h' holds an SPDX expression that cannot be parsed, skipping the file

If I run mac2unix on it, then afterwards reuse will work correctly.

kkoehne commented 9 months ago

As the name suggests, the file is intentionally using non-native file endings.

Note that even adding the path to .gitignore doesn't block reuse from parsing it (and showing above warning). Is this worth a separate bug?