Merge "Add a check if a proposed team member list is current"
This commit is contained in:
commit
894186f39f
32
tools/check-zanata-users-list.sh
Executable file
32
tools/check-zanata-users-list.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
TEAM_LIST=tools/zanata/translation_team.yaml
|
||||||
|
|
||||||
|
# This is to detect the change of the team list location.
|
||||||
|
# It is just a safe guard.
|
||||||
|
if [ ! -f $TEAM_LIST ]; then
|
||||||
|
echo "$TEAM_LIST not found. Something wrong."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git diff --name-only HEAD^ | grep -q $TEAM_LIST; then
|
||||||
|
echo "The recent commit does not touch $TEAM_LIST, so skipping the check."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMPFILE=`mktemp`
|
||||||
|
trap "rm -f $TMPFILE" EXIT
|
||||||
|
|
||||||
|
python tools/zanata/zanata_users.py --output-file $TMPFILE
|
||||||
|
if ! diff -u $TEAM_LIST $TMPFILE; then
|
||||||
|
set -x
|
||||||
|
cat <<EOF
|
||||||
|
The proposed $TEAM_LIST does not match the current Zanata team member list.
|
||||||
|
Consider reproposing it after syncing it with Zanata.
|
||||||
|
To do so, run 'tox -e zanata-users-sync'.
|
||||||
|
EOF
|
||||||
|
set +x
|
||||||
|
exit 1
|
||||||
|
fi
|
5
tox.ini
5
tox.ini
@ -35,8 +35,13 @@ commands =
|
|||||||
flake8
|
flake8
|
||||||
bash -c "find {toxinidir} -type f \( -name '*.po' -o -name '*.pot' \) -print0 | xargs -0 -n1 --no-run-if-empty msgfmt --check-format -o /dev/null"
|
bash -c "find {toxinidir} -type f \( -name '*.po' -o -name '*.pot' \) -print0 | xargs -0 -n1 --no-run-if-empty msgfmt --check-format -o /dev/null"
|
||||||
python {toxinidir}/tools/check_yaml_file.py {toxinidir}/tools/zanata/translation_team.yaml
|
python {toxinidir}/tools/check_yaml_file.py {toxinidir}/tools/zanata/translation_team.yaml
|
||||||
|
bash {toxinidir}/tools/check-zanata-users-list.sh
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
|
|
||||||
[testenv:generatepot]
|
[testenv:generatepot]
|
||||||
# Generate POT files for translation
|
# Generate POT files for translation
|
||||||
commands = {toxinidir}/tools/generatepot.sh
|
commands = {toxinidir}/tools/generatepot.sh
|
||||||
|
|
||||||
|
[testenv:zanata-users-sync]
|
||||||
|
commands =
|
||||||
|
python {toxinidir}/tools/zanata/zanata_users.py --output-file {toxinidir}/tools/zanata/translation_team.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user