Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tools/scripts/checkLicense.py
diff options
context:
space:
mode:
authorLeitwolf2026-10-25 10:31:36 +0300
committerGitHub2026-10-25 10:31:36 +0300
commitd2e3e074bb2e1b8ffd9fc990d0b87667ea602f58 (patch)
tree0bce4462b2e190c39b3e1c5f697e3e4abd1a5e2a /tools/scripts/checkLicense.py
parent13f81a480a93807c14dddb5abdb97355ced4d4c5 (diff)
parent126dc333564cb72b5115d9a9242d66694694b6d0 (diff)
downloadcatch3-d2e3e074bb2e1b8ffd9fc990d0b87667ea602f58.tar.gz
Merge pull request #18 from Progmasoft/build/catch3-identity
Give Catch3 its own build names and headers
Diffstat (limited to 'tools/scripts/checkLicense.py')
-rwxr-xr-xtools/scripts/checkLicense.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 827c94b7..9e1e24ae 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -4,6 +4,8 @@ import sys
import glob
from pathlib import Path
+from scriptCommon import upstreamFiles
+
correct_licence = """\
// Copyright Catch2 Authors
@@ -19,11 +21,15 @@ progmasoft_licence = """\
// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
"""
+upstream_files = upstreamFiles()
+
def check_licence_in_file(filename: str) -> bool:
- # Keep upstream files on BSL-1.0 while checking the fork's own source
- # and tests against their separate MPL exception header.
- expected = (progmasoft_licence if 'Progmasoft' in Path(filename).parts
- else correct_licence)
+ # Files that come from Catch2 keep BSL-1.0; the fork's own source and
+ # tests carry the MPL header with Progmasoft's exception.
+ relative = filename.replace('\\', '/')
+ progmasoft = ('Progmasoft' in Path(filename).parts
+ and relative not in upstream_files)
+ expected = progmasoft_licence if progmasoft else correct_licence
with open(filename, 'r', encoding='utf-8') as f:
file_preamble = f.read(len(expected))
@@ -44,7 +50,7 @@ def check_licences_in_path(path: str) -> int:
def check_licences():
failed = 0
# Add 'extras' after the amalgamated files are regenerated with the new script (past 3.4.0)
- roots = ['src/catch2', 'src/Progmasoft', 'tests', 'examples', 'fuzzing']
+ roots = ['src/Progmasoft', 'tests', 'examples', 'fuzzing']
for root in roots:
failed += check_licences_in_path(root)