Skip to content

Commit 8899026

Browse files
authored
Merge pull request #115 from fosslight/dl
Remove SPDX, URL from copyright
2 parents 3e738fa + 7ddad01 commit 8899026

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

LICENSES/MIT.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2+
3+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
4+
5+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/fosslight_source/_parsing_scancode_file_item.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ def parsing_file_item(scancode_file_list, has_error, need_matched_license=False)
8585
else:
8686
copyright_data = x.get("value", "")
8787
if copyright_data:
88+
try:
89+
copyright_data = re.sub(r'SPDX-License-Identifier\s*[\S]+', '', copyright_data, flags=re.I)
90+
copyright_data = re.sub(r'DownloadLocation\s*[\S]+', '', copyright_data, flags=re.I).strip()
91+
except Exception:
92+
pass
8893
copyright_value_list.append(copyright_data)
8994

9095
result_item.copyright = copyright_value_list

tests/test_files/sample.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright 2022 LG Electronics Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
* DownloadLocation: https://github.com/browserify/acorn-node
5+
* SPDX-FileCopyrightText: Copyright 2017 Free Software Foundation Europe e.V.
6+
* SPDX-License-Identifier: MIT
7+
* DownloadLocation: https://github.com/fsfe/reuse-tool
8+
*/
9+
#include <iostream>
10+
11+
int main()
12+
{
13+
std::cout << "Hello, world!" << std::endl;
14+
return 0;
15+
}

tests/test_files/temp.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright 2022 LG Electronics Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
* DownloadLocation: https://github.com/browserify/acorn-node
5+
*/
6+
#include <iostream>
7+
8+
int main()
9+
{
10+
std::cout << "Hello, world!" << std::endl;
11+
return 0;
12+
}

0 commit comments

Comments
 (0)