ec2b666284
Continuous Integration / Pre-commit Linter (push) Waiting to run
Continuous Integration / Mypy Check (Python 3.10) (push) Waiting to run
Continuous Integration / Mypy Check (Python 3.11) (push) Waiting to run
Continuous Integration / Mypy Check (Python 3.12) (push) Waiting to run
Continuous Integration / Mypy Check (Python 3.13) (push) Waiting to run
Continuous Integration / Unit Tests (Python 3.10) (push) Waiting to run
Continuous Integration / Unit Tests (Python 3.11) (push) Waiting to run
Continuous Integration / Unit Tests (Python 3.12) (push) Waiting to run
Continuous Integration / Unit Tests (Python 3.13) (push) Waiting to run
Continuous Integration / Unit Tests (Python 3.14) (push) Waiting to run
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Waiting to run
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Waiting to run
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Waiting to run
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Waiting to run
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Waiting to run
Copybara PR Handler / close-imported-pr (push) Waiting to run
53 lines
2.1 KiB
Bash
Executable File
53 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Copyright 2026 Google LLC
|
|
#
|
|
# Licensed 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.
|
|
|
|
|
|
exit_code=0
|
|
|
|
get_added_files() {
|
|
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
git diff --cached --name-only --diff-filter=A
|
|
elif jj root >/dev/null 2>&1; then
|
|
jj diff --summary 2>/dev/null | awk '/^A / {print $2}'
|
|
elif hg root >/dev/null 2>&1; then
|
|
hg status --added --no-status 2>/dev/null
|
|
elif g4 info >/dev/null 2>&1; then
|
|
g4 opened 2>/dev/null | awk '/ - add / {print $1}' | sed 's/#.*//'
|
|
elif p4 info >/dev/null 2>&1; then
|
|
p4 opened 2>/dev/null | awk '/ - add / {print $1}' | sed 's/#.*//'
|
|
fi
|
|
}
|
|
|
|
while read -r file; do
|
|
# Check if file is not empty (happens if no new files)
|
|
if [[ -n "$file" ]]; then
|
|
# Match only files in the package source (src/google/adk/) to avoid false
|
|
# positives in environments (e.g., monorepos) where the entire repository
|
|
# root is nested under a 'google/adk/' directory structure.
|
|
if [[ "$file" == */src/google/adk/*.py ]] || [[ "$file" == src/google/adk/*.py ]]; then
|
|
filename=$(basename "$file")
|
|
if [[ ! "$filename" == _* ]]; then
|
|
echo "Error: New Python file '$file' must have a '_' prefix."
|
|
echo "All new Python files in src/google/adk/ must be private by default."
|
|
echo "To expose a public interface, use __init__.py and list public symbols in __all__."
|
|
echo "See .agents/skills/adk-style/references/visibility.md for details."
|
|
exit_code=1
|
|
fi
|
|
fi
|
|
fi
|
|
done < <(get_added_files)
|
|
|
|
exit $exit_code
|