Skip to content

Commit

Permalink
[BUGFIX] Prevent side effects in rst extension scanner tags check
Browse files Browse the repository at this point in the history
There might be no comma in front of an extension
scanner tag. This should not lead to an error as
it's unrelated for this check and will already be
catched by the "validateLastLine" check.

Resolves: #102987
Releases: main, 12.4, 11.5
Change-Id: Icda7cbb1b01ced39ee80311e15bccdfd9318b953
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82718
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Jan 30, 2024
1 parent dfb80fb commit cc1d3eb
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
@@ -0,0 +1,14 @@
.. include:: /Includes.rst.txt

.. _deprecation-12345-4:

============================
Deprecation: #12345 - Test 4
============================

See :issue:`12345`

Description
===========

This file should fail, because the index line at the bottom is missing.
@@ -0,0 +1,16 @@
.. include:: /Includes.rst.txt

.. _deprecation-12345-4:

============================
Deprecation: #12345 - Test 4
============================

See :issue:`12345`

Description
===========

This file should fail, because the Scanned-Tag is invalid

.. index:: PHP-API, HalfScanned
Expand Up @@ -4,7 +4,7 @@
Deprecation: #12345 - Test 4
============================

See :issue:`83740`
See :issue:`12345`

Description
===========
Expand Down
@@ -0,0 +1,16 @@
.. include:: /Includes.rst.txt

.. _deprecation-12345-4:

============================
Deprecation: #12345 - Test 4
============================

See :issue:`12345`

Description
===========

This file should fail, because the keyword (component) is missing

.. index:: NotScanned, ext:core
2 changes: 1 addition & 1 deletion Build/Scripts/validateRstFiles.php
Expand Up @@ -194,7 +194,7 @@ protected function validateLastLineByFilename(string $path, string $lastLine)
. '[78]' // from 7.x and 8.x (as there was no extension scanner back then)
. ')'
. '#',
'regex' => '#^\.\. index:: .*[, ](?:Fully|Partially|Not)Scanned([, ]|$).*#',
'regex' => '#^\.\. index::.*(,|\s)(?:Fully|Partially|Not)Scanned([, ]|$).*#',
'title' => 'missing FullyScanned / PartiallyScanned / NotScanned tag',
'message' => 'insert \'.. index:: <at least one valid keyword and either FullyScanned, PartiallyScanned or NotScanned>\' at the last line of the file. See Build/Scripts/validateRstFiles.php for allowed keywords',
],
Expand Down

0 comments on commit cc1d3eb

Please sign in to comment.