aboutcode-org / aboutcode-org/scancode-toolkit

Wrong spdx detection for file generator

Open
#2,502 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
2.6k
Forks
791
Avg merge
1d 12h
Merged PRs (30d)
5

Description

Some of our files contain generator of source code.

Looks like this:

```
def printHeader(dest):
year = datetime.datetime.now().year
print("# Copyright (C) %s, ACME, All Right Reserved." % year, file=dest)
print("#", file=dest)
print("# This file is subject to the terms and conditions of", file=dest)
print("# ACME Software License Agreement", file=dest)
print("# SPDX-License-Identifier: LicenseRef-ACME-Proprietary", file=dest)
print("#", file=dest)
print("# DO NOT EDIT MANUALLY", file=dest)
print("# This file was autogenerated by mighty_generate.py", file=dest)
```

The 5th line got detected by the spdx matcher, but the detected SPDX license is unknown

We do add `LicenseRef-ACME-Proprietary` in our custom SPDX license, but it is not recognised, probably the end of the line is taken as part of the full SPDX ID.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.