dib-lint: ignore blank lines in element ordering
Some of the elements-deps in the project-config repo have a blank line at the end, which throws out the ordering. Strip blank lines, like comment lines, before processing. As an additional help, show a side-by-side diff of what is provided versus what is expected when showing an error about sorting. Change-Id: I007851ee01d6853ad992ce4437331e8bd79bbfce
This commit is contained in:
parent
3972510d20
commit
9189e24f6d
@ -96,10 +96,11 @@ for i in $(find elements -type f \
|
|||||||
if [ $(basename $i) = "element-deps" ]; then
|
if [ $(basename $i) = "element-deps" ]; then
|
||||||
UNSORTED=${TMPDIR}/element-deps.unsorted
|
UNSORTED=${TMPDIR}/element-deps.unsorted
|
||||||
SORTED=${TMPDIR}/element-deps.sorted
|
SORTED=${TMPDIR}/element-deps.sorted
|
||||||
grep -v '^#' $i > ${UNSORTED}
|
grep -v -e '^#' -e '^$' $i > ${UNSORTED}
|
||||||
sort ${UNSORTED} > ${SORTED}
|
sort ${UNSORTED} > ${SORTED}
|
||||||
if [ -n "$(diff -c ${UNSORTED} ${SORTED})" ]; then
|
if [ -n "$(diff -c ${UNSORTED} ${SORTED})" ]; then
|
||||||
error "$i is not sorted alphabetically"
|
error "$i is not sorted alphabetically"
|
||||||
|
diff -y ${UNSORTED} ${SORTED}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user