Skip to content
Snippets Groups Projects
Commit 7fe55fc4 authored by Anja Leichsenring's avatar Anja Leichsenring Committed by Christian Kuhn
Browse files

[TASK] Improve problem reporting of validateRstFiles.sh

Script gives now detailed advice of how to solve any
detected problem.

Resolves: #78449
Releases: master
Change-Id: I7e5cf9e74fca09bd978fdfa620cabaab2a817bcc
Reviewed-on: https://review.typo3.org/50385


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 34aff023
Branches
Tags
......@@ -23,6 +23,7 @@ for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`;
# The regex itself is correct, bash doesn't like it
if ! [[ "$fileContent" =~ ^[[:space:]]*'.. include:: ../../Includes.txt' ]]; then
INCLUDE="no include"
include_message="insert '.. include:: ../../Includes.txt' in first line of the file"
outputFileToStream=1;
else
INCLUDE=""
......@@ -32,6 +33,7 @@ for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`;
# Maybe this is because it somehow interprets them from the variable $fileContent
if ! [[ "$fileContent" =~ 'See :issue:'\`([0-9]{4,6})\` ]]; then
REFERENCE="no reference"
reference_message="insert 'See :issue:\`<issuenumber>\`' after headline"
outputFileToStream=1;
else
REFERENCE=""
......@@ -41,6 +43,7 @@ for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`;
# the last line in the checked file
if ! [[ "$fileContent" =~ '.. index:: '((TypoScript|TSConfig|TCA|FlexForm|LocalConfiguration|Fluid|FAL|Database|JavaScript|PHP-API|Frontend|Backend|CLI|RTE|ext:([a-z|A-Z|_|0-9]*))([,|[:space:]]{2})?)+$ ]]; then
INDEX="no or wrong index"
index_message="insert '.. index:: <at least one keyword>' at last line of the file"
outputFileToStream=1;
else
INDEX=""
......@@ -50,6 +53,15 @@ for i in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`;
FILE=${i/#typo3\/sysext\/core\/Documentation\/Changelog\//}
let COUNT++
printf "%-10s | %-12s | %-17s | %s \n" "$INCLUDE" "$REFERENCE" "$INDEX" "$FILE";
if ! [[ -z ${include_message} ]] ; then
echo ${include_message};
fi
if ! [[ -z ${reference_message} ]] ; then
echo ${reference_message};
fi
if ! [[ -z ${index_message} ]] ; then
echo ${index_message};
fi
fi
fi
......@@ -59,4 +71,4 @@ if [[ $COUNT > 0 ]]; then
exit 1;
else
exit 0;
fi
\ No newline at end of file
fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment