You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/01/09 16:49:57 UTC
[arrow-adbc] branch main updated: ci: only run Apache RAT on staged/committed files (#325)
This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new a8b2893 ci: only run Apache RAT on staged/committed files (#325)
a8b2893 is described below
commit a8b28933499c5d01030d1d6e01b667a762c4a93d
Author: David Li <li...@gmail.com>
AuthorDate: Mon Jan 9 11:49:52 2023 -0500
ci: only run Apache RAT on staged/committed files (#325)
Fixes #313.
---
.pre-commit-config.yaml | 2 +-
ci/scripts/run_rat_local.sh | 48 +++++++++++++++++++++++++++++++++++++++
dev/release/rat_exclude_files.txt | 3 +++
3 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5bece5d..8523fa2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -82,6 +82,6 @@ repos:
name: Check for unapproved licenses
language: script
pass_filenames: false
- entry: "./dev/release/run-rat.sh ."
+ entry: "./ci/scripts/run_rat_local.sh"
exclude: "^c/vendor/.*"
diff --git a/ci/scripts/run_rat_local.sh b/ci/scripts/run_rat_local.sh
new file mode 100755
index 0000000..4a68c99
--- /dev/null
+++ b/ci/scripts/run_rat_local.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Run Apache RAT on the local repository to check for licenses
+
+set -e
+
+main() {
+ local -r source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ local -r source_top_dir="$(cd "${source_dir}/../../" && pwd)"
+
+ pushd "${source_top_dir}"
+
+ # Generate a temporary archive and validate that, ignores build
+ # artifacts (RAT itself doesn't respect .gitignore)
+ export ARCHIVE=$(mktemp adbc.ratXXXXXXXX)
+ trap 'rm -f "$ARCHIVE"' ERR EXIT INT TERM
+
+ # Need to prefix with directory since check-rat-report.py always removes one layer
+ if [[ "$(uname)" = "Darwin" ]]; then
+ git ls-files | tar -s '|.*|adbc/~|' --files-from=- --create --gzip --file="${ARCHIVE}"
+ else
+ git ls-files | tar --transform='s|^|adbc/|' --files-from=- --create --gzip --file="${ARCHIVE}"
+ fi
+
+ "${source_top_dir}/dev/release/run-rat.sh" "${ARCHIVE}"
+
+ popd
+}
+
+main "$@"
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index 2b1587e..9d68138 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -3,6 +3,9 @@ ci/linux-packages/changelog
ci/linux-packages/*.install
dev/release/rat_exclude_files.txt
filtered_rat.txt
+go/adbc/drivermgr/adbc.h
+go/adbc/drivermgr/adbc_driver_manager.cc
+go/adbc/drivermgr/adbc_driver_manager.h
go/adbc/status_string.go
go/adbc/go.sum
rat.txt