3 #########################
5 # Check all rst snippets
6 # in typo3/sysext/core/Documentation/Changelog
8 # It expects to be run from the core root.
10 ##########################
12 echo 'Searching for rst snippets'
15 for i
in `find typo3/sysext/core/Documentation/Changelog -name "*.rst" -type f`; do
16 if [[ "${i}" != "${i%.${EXT}}" && ! $i =~
'Index.rst' && ! $i =~
'Howto.rst' ]];then
19 fileContent
=$
(cat $i);
22 # This regex needs to allow whitespace and/or newlines before the .. include:: ../../Includes.txt
23 # The regex itself is correct, bash doesn't like it
24 if ! [[ "$fileContent" =~ ^
[[:space
:]]*'.. include:: ../../Includes.txt' ]]; then
26 include_message
="insert '.. include:: ../../Includes.txt' in first line of the file"
32 # This regex seems to have problems with the backtick characters.
33 # Maybe this is because it somehow interprets them from the variable $fileContent
34 if ! [[ "$fileContent" =~
'See :issue:'\
`([0-9]{4,6})\` ]]; then
35 REFERENCE
="no reference"
36 reference_message
="insert 'See :issue:\`<issuenumber>\`' after headline"
42 # This regex needs to check that the ..index:: line a) holds valid content and b) is
43 # the last line in the checked file
44 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
45 INDEX
="no or wrong index"
46 index_message
="insert '.. index:: <at least one keyword>' at last line of the file"
51 # Output filename in case any error was found
52 if [ $outputFileToStream == 1 ] ; then
53 FILE
=${i/#typo3\/sysext\/core\/Documentation\/Changelog\//}
55 printf "%-10s | %-12s | %-17s | %s \n" "$INCLUDE" "$REFERENCE" "$INDEX" "$FILE";
56 if ! [[ -z ${include_message} ]] ; then
57 echo ${include_message};
59 if ! [[ -z ${reference_message} ]] ; then
60 echo ${reference_message};
62 if ! [[ -z ${index_message} ]] ; then
63 echo ${index_message};
69 if [[ $COUNT > 0 ]]; then
70 >&2 echo "Found $COUNT rst files with errors, check full log for details.";