From e0c70e102a38f69c29a5d661f02a5adf576d8ed5 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 11:18:16 -0500 Subject: [PATCH 1/9] upgrade rat to use 0.17 --- dev/check-license | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/check-license b/dev/check-license index e929e68bf93c..f79bb017959d 100755 --- a/dev/check-license +++ b/dev/check-license @@ -58,7 +58,7 @@ else declare java_cmd=java fi -export RAT_VERSION=0.16.1 +export RAT_VERSION=0.17 export rat_jar="$FWDIR"/lib/apache-rat-${RAT_VERSION}.jar mkdir -p "$FWDIR"/lib @@ -68,7 +68,9 @@ mkdir -p "$FWDIR"/lib } mkdir -p build -$java_cmd -jar "$rat_jar" --scan-hidden-directories -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > build/rat-results.txt +$java_cmd -jar "$rat_jar" \ + --input-exclude-file "$FWDIR"/dev/.rat-excludes \ + -- "$FWDIR" > build/rat-results.txt if [ $? -ne 0 ]; then echo "RAT exited abnormally" From 9f73c55ffe57ef1558c89a86fa48e39179b4cd09 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 11:18:23 -0500 Subject: [PATCH 2/9] translate exclusion expression --- dev/.rat-excludes | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/dev/.rat-excludes b/dev/.rat-excludes index 6dbaa6fccdc5..c8669ce7046c 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -5,31 +5,31 @@ iceberg-build.properties .java-version books.json new-books.json -build +**/build/** .gitignore -.git -.gradle -.idea +.git/** +.gradle/** +.idea/** .rat-excludes -LICENSE -NOTICE -revapi.yml +**/LICENSE +**/NOTICE +**/revapi.yml gradlew -examples/* -gradle/* -.*\.sql -.*\.iml -.*\.iws -.*\.html -.*\.css -.*\.js -.*\.svg -.*\.lock -.*\.json -.*\.bin -.*\.prefs -package-list +examples/** +gradle/** +**/*.sql +**/*.iml +**/*.iws +**/*.html +**/*.css +**/*.js +**/*.svg +**/*.lock +**/*.json +**/*.bin +**/*.prefs +**/package-list sitemap.xml -derby.log +**/derby.log .python-version -.*_index.md +**/*_index.md From 4ddd83256c86fdd1204ccc13926b6093d8ab19eb Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 13:12:01 -0500 Subject: [PATCH 3/9] fix script --- dev/check-license | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dev/check-license b/dev/check-license index f79bb017959d..09173927e78e 100755 --- a/dev/check-license +++ b/dev/check-license @@ -67,22 +67,17 @@ mkdir -p "$FWDIR"/lib exit 1 } +RAT_RESULTS=build/rat-results.txt + mkdir -p build $java_cmd -jar "$rat_jar" \ --input-exclude-file "$FWDIR"/dev/.rat-excludes \ - -- "$FWDIR" > build/rat-results.txt + -- "$FWDIR" > "$RAT_RESULTS" 2>&1 if [ $? -ne 0 ]; then - echo "RAT exited abnormally" + echo "Could not find Apache license headers in the following files:" + cat "$RAT_RESULTS" exit 1 fi -ERRORS="$(cat build/rat-results.txt | grep -e "??")" - -if test ! -z "$ERRORS"; then - echo "Could not find Apache license headers in the following files:" - echo "$ERRORS" - exit 1 -else - echo -e "RAT checks passed." -fi +echo "RAT checks passed." From 98ada16ea78ca83e7ed352b58461c7d7af31c446 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 13:19:59 -0500 Subject: [PATCH 4/9] simplify --- dev/check-license | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dev/check-license b/dev/check-license index 09173927e78e..2b4195b410e3 100755 --- a/dev/check-license +++ b/dev/check-license @@ -67,17 +67,8 @@ mkdir -p "$FWDIR"/lib exit 1 } -RAT_RESULTS=build/rat-results.txt - -mkdir -p build $java_cmd -jar "$rat_jar" \ --input-exclude-file "$FWDIR"/dev/.rat-excludes \ - -- "$FWDIR" > "$RAT_RESULTS" 2>&1 - -if [ $? -ne 0 ]; then - echo "Could not find Apache license headers in the following files:" - cat "$RAT_RESULTS" - exit 1 -fi + -- "$FWDIR" || exit 1 echo "RAT checks passed." From 04e40fae7c1b24868b56b31ddc7e732c82cbb77f Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 14:20:30 -0500 Subject: [PATCH 5/9] config --- dev/check-license | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/check-license b/dev/check-license index 2b4195b410e3..23bb43eba309 100755 --- a/dev/check-license +++ b/dev/check-license @@ -69,6 +69,8 @@ mkdir -p "$FWDIR"/lib $java_cmd -jar "$rat_jar" \ --input-exclude-file "$FWDIR"/dev/.rat-excludes \ + --output-style missing-headers \ + --log-level ERROR \ -- "$FWDIR" || exit 1 echo "RAT checks passed." From 9f33e9156287b6cd5e7753443098d43eadf4befb Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 14:26:55 -0500 Subject: [PATCH 6/9] explicit --- dev/.rat-excludes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/.rat-excludes b/dev/.rat-excludes index c8669ce7046c..8d38fc62cc1f 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -10,7 +10,7 @@ new-books.json .git/** .gradle/** .idea/** -.rat-excludes +dev/.rat-excludes **/LICENSE **/NOTICE **/revapi.yml From b126586c86608ed0762cad958ddcb1a683753bf4 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 14:31:20 -0500 Subject: [PATCH 7/9] test, this should fail --- tmp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tmp diff --git a/tmp b/tmp new file mode 100644 index 000000000000..f9c9adaffd6d --- /dev/null +++ b/tmp @@ -0,0 +1 @@ +no headers here \ No newline at end of file From 9642d17bc5dbb612a0589eaadc4b92e8a6a4a0d3 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Mon, 26 Jan 2026 14:31:25 -0500 Subject: [PATCH 8/9] Revert "test, this should fail" This reverts commit b126586c86608ed0762cad958ddcb1a683753bf4. --- tmp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tmp diff --git a/tmp b/tmp deleted file mode 100644 index f9c9adaffd6d..000000000000 --- a/tmp +++ /dev/null @@ -1 +0,0 @@ -no headers here \ No newline at end of file From ca41869354e7685d148fbfb0beb78556b3521c50 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Tue, 27 Jan 2026 08:39:17 -0800 Subject: [PATCH 9/9] scan hidden dir --- dev/check-license | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/check-license b/dev/check-license index 23bb43eba309..c29be7c4bded 100755 --- a/dev/check-license +++ b/dev/check-license @@ -69,6 +69,7 @@ mkdir -p "$FWDIR"/lib $java_cmd -jar "$rat_jar" \ --input-exclude-file "$FWDIR"/dev/.rat-excludes \ + --input-include-std HIDDEN_DIR \ --output-style missing-headers \ --log-level ERROR \ -- "$FWDIR" || exit 1