bin/find-unused-data.sh | 24 ++++++++++++++++++++++++ sw/qa/extras/find-unused-data.sh | 11 ----------- 2 files changed, 24 insertions(+), 11 deletions(-)
New commits: commit 1b9702920dc7a3c36b19bbcae81176b0ad1bb0cd Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu May 18 11:28:12 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu May 18 20:45:57 2023 +0200 find-unused-data.sh: move script to bin and adapt it to check the whole repository Change-Id: Ic2df1248604e6e0053a8eeda50869eb5a3b1db0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151942 Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/bin/find-unused-data.sh b/bin/find-unused-data.sh new file mode 100755 index 000000000000..8ca4cfc10d6c --- /dev/null +++ b/bin/find-unused-data.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +SCRIPT=$(realpath "$0") +SCRIPTPATH=$(dirname "$SCRIPT") +PATHES="$(find $SCRIPTPATH/.. \( -wholename '*/qa/*/testdocuments' -o -wholename '*/qa/*/testdocuments/*' -o -wholename '*/qa/*/data' -o -wholename '*/qa/*/data/*' \) -type d )" + +for path in $PATHES +do + # Ignore pass/fail/inderterminate folders, functions test in sc, workdir folder and xml in sd + if [[ "$path" != */pass* ]] && [[ "$path" != */fail* ]] && [[ "$path" != */indeterminate* ]] \ + && [[ "$path" != */functions* ]] && [[ "$path" != */workdir* ]] && [[ "$path" != */xml* ]]; then + for i in $path/* + do + if [ -f "$i" ]; then + file=$(basename "$i") + if ! git grep -q "$file"; then + echo "WARNING: $i is not used, write a testcase for it!" + fi + fi + done + fi +done + +# vi:set shiftwidth=4 expandtab: diff --git a/sw/qa/extras/find-unused-data.sh b/sw/qa/extras/find-unused-data.sh deleted file mode 100755 index 460c01caaaec..000000000000 --- a/sw/qa/extras/find-unused-data.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -for i in */data/* -do - file=$(basename "$i") - if ! git grep -q "$file"; then - echo "WARNING: $i is not used, write a testcase for it!" - fi -done - -# vi:set shiftwidth=4 expandtab: