project-config/tools/check-channels-yaml.sh
Clint Adams 952bc590ba Test formatting of gerritbot/channels.yaml
Ensure that the output of tools/normalize_channels_yaml.py matches
gerritbot/channels.yaml modulo any comments.

Change-Id: I3147cb094a795aeeffcceda182d065ed5145c2dd
Depends-On: Ia710997f37e8fba4a18b26577ecac42dd3137e2a
2015-09-29 09:56:18 -04:00

13 lines
408 B
Bash
Executable File

#!/bin/bash
T=$(mktemp -d)
trap "rm -rf $T" EXIT
channels_file=${1:-gerritbot/channels.yaml}
# strip comments so that output can be compared meaningfully
(printf "# This file is sorted alphabetically by channel name.\n"; sed '/^[[:space:]]*#.*$/d;s/[[:space:]]*#.*$//' gerritbot/channels.yaml) > $T/comments-removed
./tools/normalize_channels_yaml.py >$T/regenned
diff -u $T/comments-removed $T/regenned