Browse Source

Merge pull request #16227 from dskarzh/chore/move-license-header-templates-lts-4.4

chore: move license header templates out of repository root on lts-4.4
pull/16235/head
Viacheslav Klimov 2 months ago
committed by GitHub
parent
commit
dd243a134f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      pom.xml
  2. 7
      tools/src/main/python/license-headers/check_license_headers.py
  3. 0
      tools/src/main/python/license-headers/templates/license-header-busl.txt
  4. 0
      tools/src/main/python/license-headers/templates/license-header-ce-modified.txt
  5. 0
      tools/src/main/python/license-headers/templates/license-header.txt
  6. 1
      tools/src/main/python/license-headers/test_check_license_headers.py

6
pom.xml

@ -937,10 +937,10 @@
<configuration>
<licenseSets>
<licenseSet>
<header>${main.dir}/license-header-busl.txt</header>
<header>${main.dir}/tools/src/main/python/license-headers/templates/license-header-busl.txt</header>
<validHeaders>
<validHeader>${main.dir}/license-header.txt</validHeader>
<validHeader>${main.dir}/license-header-ce-modified.txt</validHeader>
<validHeader>${main.dir}/tools/src/main/python/license-headers/templates/license-header.txt</validHeader>
<validHeader>${main.dir}/tools/src/main/python/license-headers/templates/license-header-ce-modified.txt</validHeader>
</validHeaders>
<excludes>
<exclude>**/.env</exclude>

7
tools/src/main/python/license-headers/check_license_headers.py

@ -25,9 +25,9 @@ import xml.etree.ElementTree as ET
TEMPLATES = {
"apache": "license-header.txt",
"ce-modified": "license-header-ce-modified.txt",
"pe-only": "license-header-busl.txt",
"apache": "tools/src/main/python/license-headers/templates/license-header.txt",
"ce-modified": "tools/src/main/python/license-headers/templates/license-header-ce-modified.txt",
"pe-only": "tools/src/main/python/license-headers/templates/license-header-busl.txt",
}
CE_REMOTE = "https://github.com/thingsboard/thingsboard.git"
CURATIONS = "tools/src/main/python/license-headers/curations.json"
@ -509,6 +509,7 @@ class Mycila:
self.sentinel = ("license-provenance-" + uuid.uuid4().hex).encode("ascii")
self.templates = {header: (repo / name).read_bytes() for header, name in TEMPLATES.items()}
for header, name in TEMPLATES.items():
(directory / name).parent.mkdir(parents=True, exist_ok=True)
(directory / name).write_bytes(self.templates[header])
def add(self, key, name, content):

0
license-header-busl.txt → tools/src/main/python/license-headers/templates/license-header-busl.txt

0
license-header-ce-modified.txt → tools/src/main/python/license-headers/templates/license-header-ce-modified.txt

0
license-header.txt → tools/src/main/python/license-headers/templates/license-header.txt

1
tools/src/main/python/license-headers/test_check_license_headers.py

@ -386,6 +386,7 @@ class GitHistoryTests(unittest.TestCase):
def test_normalized_copy_search_is_bounded_and_ignores_empty_sources(self):
repo = temporary_directory(self)
for name in p.TEMPLATES.values():
(repo / name).parent.mkdir(parents=True, exist_ok=True)
(repo / name).write_text("fixture header\n")
tool = p.Mycila(repo, temporary_directory(self), fixture_plugin())
source, empty = ("Source.java", "blob"), ("Empty.java", "empty")

Loading…
Cancel
Save