mirror of
https://opendev.org/openstack/governance.git
synced 2026-01-16 23:00:30 +00:00
Ensure that reference/projects.yaml is sorted
Add to docs tox target a check that reference/projects.yaml is sorted alphabetically and display entries that are not sorted. Change-Id: Ia86b50622e2fac5fdf791d57c884d2d8a9ec6c44
This commit is contained in:
parent
c288b66fd9
commit
cacc105773
2 changed files with 25 additions and 0 deletions
24
tools/check_projects_yaml_alphabetized.sh
Executable file
24
tools/check_projects_yaml_alphabetized.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash -xe
|
||||
|
||||
# Checks that reference/projects.yaml alphabetized and prints list of
|
||||
# projects that should be sorted.
|
||||
|
||||
export TMPDIR=`/bin/mktemp -d`
|
||||
trap "rm -rf $TMPDIR" EXIT
|
||||
|
||||
pushd $TMPDIR
|
||||
PROJECTS_LIST=$OLDPWD/reference/projects.yaml
|
||||
|
||||
grep '^[a-zA-Z0-9]' $PROJECTS_LIST > projects_list
|
||||
|
||||
LC_ALL=C sort --ignore-case projects_list -o projects_list.sorted
|
||||
|
||||
if ! diff projects_list projects_list.sorted > projects_list.diff; then
|
||||
echo "The following projects should be alphabetized: "
|
||||
cat projects_list.diff | grep -e '> '
|
||||
exit 1
|
||||
else
|
||||
echo "Projects alphabetized."
|
||||
fi
|
||||
|
||||
popd
|
||||
1
tox.ini
1
tox.ini
|
|
@ -14,3 +14,4 @@ commands = {posargs}
|
|||
|
||||
[testenv:docs]
|
||||
commands = python setup.py build_sphinx
|
||||
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue