diff --git a/src/reuse/__init__.py b/src/reuse/__init__.py index 7b98506c0..afd55efc0 100644 --- a/src/reuse/__init__.py +++ b/src/reuse/__init__.py @@ -71,6 +71,7 @@ re.compile(r"^\.gitkeep$"), re.compile(r"^\.hgtags$"), re.compile(r".*\.license$"), + re.compile(r"^REUSE\.toml$"), # Workaround for https://github.com/fsfe/reuse-tool/issues/229 re.compile(r"^CAL-1.0(-Combined-Work-Exception)?(\..+)?$"), re.compile(r"^SHL-2.1(\..+)?$"), diff --git a/tests/resources/REUSE.toml b/tests/resources/REUSE.toml index 6c2f15e5b..8aa7ebaf9 100644 --- a/tests/resources/REUSE.toml +++ b/tests/resources/REUSE.toml @@ -1,7 +1,3 @@ -# SPDX-FileCopyrightText: 2017 Jane Doe -# -# SPDX-License-Identifier: CC0-1.0 - version = 1 [[annotations]] diff --git a/tests/test_project.py b/tests/test_project.py index 0041466ea..c7744eac8 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -274,6 +274,13 @@ def test_all_files_pijul_ignored_contains_newline(pijul_repository): assert Path("hello\nworld.pyc").absolute() not in project.all_files() +def test_all_files_reuse_toml_ignored(empty_directory): + """REUSE.toml is ignored.""" + (empty_directory / "REUSE.toml").write_text("version = 1") + project = Project.from_directory(empty_directory) + assert not list(project.all_files()) + + def test_reuse_info_of_file_does_not_exist(fake_repository): """Raise FileNotFoundError when asking for the REUSE info of a file that does not exist.