Skip to content

Commit cef7440

Browse files
kevinjqliukris-gaudel
authored andcommitted
Upgrade to RAT 0.17 (#2992)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change (Copy over RAT upgrade changes from java, #15145, #15174, #15194) Upgrades RAT to version 0.17, which has new regex for [exclusion expression](https://creadur.apache.org/rat/apache-rat-core/exclusion_expression.html) * Using `--input-exclude-file` because `-E,--exclude-file` is deprecated * Using `--input-include-std HIDDEN_DIR` because `--scan-hidden-directories` is deprecated * Using the new [`--output-style missing-headers` option](https://creadur.apache.org/rat/apache-rat/index.html) for output styling Add usage of the new collections for ignore file patterns https://creadur.apache.org/rat/apache-rat/standard_collections.html - `GIT` matches `**/.git/**`, `**/.gitignore` - `IDEA` matches `**/*.iws`, `**/*.iml`, `**/*.ipr`, `**/.idea/**` - `MAC` matches `**/.DS_Store` ## Are these changes tested? yes locally and ci ## Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent df02f2e commit cef7440

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

dev/.rat-excludes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.github/*
2-
.rat-excludes
3-
build
4-
.git
5-
.gitignore
1+
.github/**
2+
dev/.rat-excludes
63
uv.lock
7-
mkdocs/*
8-
notebooks/*
4+
.ruff_cache/**
5+
.pytest_cache/**
6+
.mypy_cache/**
7+
mkdocs/**
8+
notebooks/**

dev/check-license

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ else
5858
declare java_cmd=java
5959
fi
6060

61-
export RAT_VERSION=0.16.1
61+
export RAT_VERSION=0.17
6262
export rat_jar="$FWDIR"/lib/apache-rat-${RAT_VERSION}.jar
6363
mkdir -p "$FWDIR"/lib
6464

@@ -67,20 +67,12 @@ mkdir -p "$FWDIR"/lib
6767
exit 1
6868
}
6969

70-
mkdir -p build
71-
$java_cmd -jar "$rat_jar" --scan-hidden-directories -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > build/rat-results.txt
70+
$java_cmd -jar "$rat_jar" \
71+
--input-exclude-file "$FWDIR"/dev/.rat-excludes \
72+
--input-exclude-std GIT IDEA MAC \
73+
--input-include-std HIDDEN_DIR \
74+
--output-style missing-headers \
75+
--log-level ERROR \
76+
-- "$FWDIR" || exit 1
7277

73-
if [ $? -ne 0 ]; then
74-
echo "RAT exited abnormally"
75-
exit 1
76-
fi
77-
78-
ERRORS="$(cat build/rat-results.txt | grep -e "??")"
79-
80-
if test ! -z "$ERRORS"; then
81-
echo "Could not find Apache license headers in the following files:"
82-
echo "$ERRORS"
83-
exit 1
84-
else
85-
echo -e "RAT checks passed."
86-
fi
78+
echo "RAT checks passed."

0 commit comments

Comments
 (0)