Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions dev/.rat-excludes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

about the new regex syntax.
**/build/**, matches any folder name "build"
.git/**, matches top level dir name .git and excludes all its files
dev/.rat-excludes, matches this 1 file explicitly
**/LICENSE, matches any file name "LICENSE"
**/*.sql, matches any file with .sql suffix

Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ iceberg-build.properties
.java-version
books.json
new-books.json
build
**/build/**
.gitignore
.git
.gradle
.idea
.rat-excludes
LICENSE
NOTICE
revapi.yml
.git/**
.gradle/**
.idea/**
dev/.rat-excludes
**/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
25 changes: 8 additions & 17 deletions dev/check-license
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -67,20 +67,11 @@ mkdir -p "$FWDIR"/lib
exit 1
}

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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we are not scanning hidden directories any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, we should!

--input-include-std HIDDEN_DIR \
--output-style missing-headers \
--log-level ERROR \
-- "$FWDIR" || exit 1

if [ $? -ne 0 ]; then
echo "RAT exited abnormally"
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."