This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch release-0.3
in repository https://gitbox.apache.org/repos/asf/paimon-vector-index.git
The following commit(s) were added to refs/heads/release-0.3 by this push:
new b98ce22 fix: support license checks in source archives
b98ce22 is described below
commit b98ce22f800bf1ff3a17bee20d4d2ef0b69fb036
Author: JingsongLi <[email protected]>
AuthorDate: Sun Jul 26 15:06:42 2026 +0800
fix: support license checks in source archives
---
tools/check_license_headers.py | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/tools/check_license_headers.py b/tools/check_license_headers.py
index 3095b3a..c959926 100755
--- a/tools/check_license_headers.py
+++ b/tools/check_license_headers.py
@@ -17,7 +17,7 @@
# limitations under the License.
#
-"""Validate ASF license headers on tracked text files."""
+"""Validate ASF license headers on source text files."""
from __future__ import annotations
@@ -51,14 +51,22 @@ EXEMPT_FILES = {
def repo_root() -> Path:
- return Path(
- subprocess.check_output(["git", "rev-parse", "--show-toplevel"],
text=True).strip()
- )
+ return Path(__file__).resolve().parent.parent
+
+def source_files(root: Path) -> list[str]:
+ result = subprocess.run(
+ ["git", "-C", str(root), "rev-parse", "--show-toplevel"],
+ capture_output=True,
+ text=True,
+ )
+ if result.returncode == 0 and Path(result.stdout.strip()).resolve() ==
root:
+ output = subprocess.check_output(["git", "-C", str(root), "ls-files"],
text=True)
+ return output.splitlines()
-def tracked_files(root: Path) -> list[str]:
- output = subprocess.check_output(["git", "-C", str(root), "ls-files"],
text=True)
- return output.splitlines()
+ return sorted(
+ path.relative_to(root).as_posix() for path in root.rglob("*") if
path.is_file()
+ )
def is_text_file(path: Path) -> bool:
@@ -74,7 +82,7 @@ def main() -> int:
root = repo_root()
missing = []
- for file_name in tracked_files(root):
+ for file_name in source_files(root):
if file_name in EXEMPT_FILES:
continue
@@ -91,7 +99,7 @@ def main() -> int:
print(f" {file_name}", file=sys.stderr)
return 1
- print("All tracked text files have ASF license headers or are explicitly
exempt.")
+ print("All source text files have ASF license headers or are explicitly
exempt.")
return 0