Skip to content

Commit

Permalink
Ignore CAL-1.0 and CAL-1.0-Combined-Work-Exception
Browse files Browse the repository at this point in the history
These licenses contain SPDX tags referring to themselves. This causes
issues in <fsfe#229>. Ignoring them
is a workaround.

Signed-off-by: Carmen Bianca Bakker <[email protected]>
  • Loading branch information
Carmen Bianca Bakker committed May 25, 2020
1 parent 014cc70 commit f0637ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ The versions follow [semantic versioning](https://semver.org).

### Fixed

- The licenses CAL-1.0 and CAL-1.0-Combined-Work-Exception contain an SPDX tag
within themselves. Files that are named after these licenses are now ignored.

### Security

## 0.10.1 - 2020-05-14
Expand Down
2 changes: 2 additions & 0 deletions src/reuse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
re.compile(r"^\.gitkeep$"),
re.compile(r".*\.license$"),
re.compile(r".*\.spdx$"),
# Workaround for https://github.com/fsfe/reuse-tool/issues/229
re.compile(r"^CAL-1.0(-Combined-Work-Exception)?(\..+)?$"),
]

#: Simple structure for holding SPDX information.
Expand Down
13 changes: 13 additions & 0 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ def test_all_files_ignore_dot_license(empty_directory):
assert {file_.name for file_ in project.all_files()} == {"foo"}


def test_all_files_ignore_cal_license(empty_directory):
"""CAL licenses contain SPDX tags referencing themselves. They should be
skipped.
"""
(empty_directory / "CAL-1.0").write_text("foo")
(empty_directory / "CAL-1.0.txt").write_text("foo")
(empty_directory / "CAL-1.0-Combined-Work-Exception").write_text("foo")
(empty_directory / "CAL-1.0-Combined-Work-Exception.txt").write_text("foo")

project = Project(empty_directory)
assert not list(project.all_files())


def test_all_files_ignore_git(empty_directory):
"""When the git directory is present, ignore it."""
(empty_directory / ".git").mkdir()
Expand Down

0 comments on commit f0637ad

Please sign in to comment.