From 24c294fa357c813e1f4baa24b412bebc5592d89b Mon Sep 17 00:00:00 2001 From: Dmytro Skarzhynets Date: Tue, 29 Sep 2026 12:41:46 +0300 Subject: [PATCH 1/2] chore: move license header template out of repository root --- pom.xml | 2 +- .../main/python/license-headers/templates/license-header.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename license-header.txt => tools/src/main/python/license-headers/templates/license-header.txt (100%) diff --git a/pom.xml b/pom.xml index 76920fadeb..e8f42b3243 100755 --- a/pom.xml +++ b/pom.xml @@ -891,7 +891,7 @@ -
${main.dir}/license-header.txt
+
${main.dir}/tools/src/main/python/license-headers/templates/license-header.txt
**/.env **/*.env diff --git a/license-header.txt b/tools/src/main/python/license-headers/templates/license-header.txt similarity index 100% rename from license-header.txt rename to tools/src/main/python/license-headers/templates/license-header.txt From 76cc057266a5ddf205b344b606911f8d84042c48 Mon Sep 17 00:00:00 2001 From: Dmytro Skarzhynets Date: Tue, 29 Sep 2026 12:44:21 +0300 Subject: [PATCH 2/2] chore: move remaining license header templates out of repository root --- pom.xml | 4 ++-- .../main/python/license-headers/check_license_headers.py | 7 ++++--- .../license-headers/templates/license-header-busl.txt | 0 .../templates/license-header-ce-modified.txt | 0 .../python/license-headers/test_check_license_headers.py | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) rename license-header-busl.txt => tools/src/main/python/license-headers/templates/license-header-busl.txt (100%) rename license-header-ce-modified.txt => tools/src/main/python/license-headers/templates/license-header-ce-modified.txt (100%) diff --git a/pom.xml b/pom.xml index c61ba01499..2c29074a8c 100755 --- a/pom.xml +++ b/pom.xml @@ -937,10 +937,10 @@ -
${main.dir}/license-header-busl.txt
+
${main.dir}/tools/src/main/python/license-headers/templates/license-header-busl.txt
${main.dir}/tools/src/main/python/license-headers/templates/license-header.txt - ${main.dir}/license-header-ce-modified.txt + ${main.dir}/tools/src/main/python/license-headers/templates/license-header-ce-modified.txt **/.env diff --git a/tools/src/main/python/license-headers/check_license_headers.py b/tools/src/main/python/license-headers/check_license_headers.py index 5d54b40db0..13ff9f75ad 100644 --- a/tools/src/main/python/license-headers/check_license_headers.py +++ b/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): diff --git a/license-header-busl.txt b/tools/src/main/python/license-headers/templates/license-header-busl.txt similarity index 100% rename from license-header-busl.txt rename to tools/src/main/python/license-headers/templates/license-header-busl.txt diff --git a/license-header-ce-modified.txt b/tools/src/main/python/license-headers/templates/license-header-ce-modified.txt similarity index 100% rename from license-header-ce-modified.txt rename to tools/src/main/python/license-headers/templates/license-header-ce-modified.txt diff --git a/tools/src/main/python/license-headers/test_check_license_headers.py b/tools/src/main/python/license-headers/test_check_license_headers.py index b2efdfeb88..e017fad801 100644 --- a/tools/src/main/python/license-headers/test_check_license_headers.py +++ b/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")